<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- saved from url=(0034)http://localhost:7001/cerp/cerpTop -->
<HTML><HEAD>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<TITLE></TITLE><LINK href="cerpTop.files/top.htm" type=text/css 
rel=stylesheet>
<SCRIPT language=JavaScript src="cerpTop.files/url.htm"></SCRIPT>

<SCRIPT language=JavaScript>
<!--
function makevisible(cur,which)
{
	if (which==0)
		cur.filters.alpha.opacity=100
	else
	cur.filters.alpha.opacity=50
}

function MouseOn(res)
 {
  if(!res.contains(event.fromElement))
  {
    bgColor = res.style.backgroundColor;
    res.style.cursor="hand";
    res.style.backgroundColor=bgColor;
    res.src="/nat/panther/pub/images/top/myDesk1.gif";
  }
 }
function MouseOut(res)
 {
  if(!res.contains(event.toElement))
   {
    res.style.cursor="Default";
//    res.style.backgroundColor="#FFFFFF";
    res.style.backgroundColor=bgColor;
    res.src="/nat/panther/pub/images/top/myDesk.gif";
   }
 }
function MouseOuto(res)
{
 if(!res.contains(event.toElement))
 {
  res.style.cursor="Default";
//  res.style.backgroundColor="#EEEEEE";
  res.style.backgroundColor=bgColor;
    res.src="/nat/panther/pub/images/top/myDesk.gif";
 }
}
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function printPage()
{
        var frame = parent.main;
        frame.focus();
        frame.self.print();
}
function setDefaultPage()
{
        url = parent.main.location.href;
        url = getCodedURL(url);
        url = '/cerp/setDefaultPage?m_url='+url;
        window.open(url,"aux","");
        return false;
}
function switchLanguage()
{
        var m_url = '/cerp/switchLanguage';
        window.open(m_url,"aux","");
        return false;
}
function addFavor()
{

        var m_url = parent.main.location.href;
        m_url = getCodedURL(m_url);
        m_url = '/cerp/addFavor?pSysCode=moa&pProgCode=addFavor&opFlag=addNew&m_url='+m_url;
        window.open(m_url,"_blank","left=270 top=140 width=500 height=330 location=no scrollbars=no menubar=no");
        return false;
}

function passwd()
{
        window.open("/cerp/passwd","","left=400 top=300 width=314 height=200 location=no scrollbars=no menubar=no");
        return false;
}

function relogin()
{
        window.open("/cerp/relogin?user_code=admin","","left=400 top=300 width=314 height=190 location=no scrollbars=no menubar=no");
        return false;
}

function myBag()
{
        window.open("/cerp/mybag","main","");
        return false;
}

function about()
{
        window.open("/cerp/about","","left=200 top=200 width=600 height=370 location=no scrollbars=no menubar=no");
        return false;
}

function help()
{
        window.open("/cerp/help","","left=100 top=100 width=800 height=600 location=no scrollbars=no menubar=no");
        return false;
}
function exit()
{
        window.open("/cerp/exit","","left=100 top=100 width=800 height=600 location=no scrollbars=no menubar=no");
        return false;
}
//MM_preloadImages('/nat/panther/pub/images/login/cerptop_r1_c5_f2.gif','/nat/panther/pub/images/login/cerptop_r1_c8_f2.gif','/nat/panther/pub/images/login/cerptop_r1_c11_f2.gif','/nat/panther/pub/images/login/cerptop_r1_c15_f2.gif','/nat/panther/pub/images/login/cerptop_r1_c19_f2.gif','/nat/panther/pub/images/login/cerptop_r1_c22_f2.gif','/nat/panther/pub/images/login/cerptop_r1_c26_f2.gif');
//-->
</SCRIPT>
<!--modifid by cameran hereXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX-->
<SCRIPT>
function tick()
{
    var _day = new Array(7);
		_day[0]='日';
		_day[1]='一';
		_day[2]='二';
		_day[3]='三';
		_day[4]='四';
		_day[5]='五';
		_day[6]='六';

		var week,mydate;
    var hours, minutes, seconds, xfile;
    var intHours, intMinutes, intSeconds;
    var today;

    today = new Date();

    mydate = today.getFullYear()+'年'+eval(today.getMonth()+1)+'月'+today.getDate()+'日';

    week = '星期'	+_day[today.getDay()];

    intHours = today.getHours();
    intMinutes = today.getMinutes();
    intSeconds = today.getSeconds();
    if (intHours == 0)
    {
        hours = "12:";
        xfile = "午夜";
    }
    else if (intHours < 5)
    {
        hours = intHours+":";
        xfile = "凌晨";
    }
    else if (intHours < 8)
    {
        hours = intHours+":";
        xfile = "清晨";
    }
    else if (intHours < 12)
    {
        hours = intHours+":";
        xfile = "上午";
    }
    else if (intHours == 12)
    {
        hours = "12:";
        xfile = "中午";
    }
    else if(intHours <18)
    {
        intHours = intHours - 12
        hours = intHours + ":";
        xfile = "下午";
    }
    else if(intHours <20)
    {
        intHours = intHours - 12
        hours = intHours + ":";
        xfile = "傍晚";
    }
    else if(intHours <=23)
    {
        intHours = intHours - 12
        hours = intHours + ":";
        xfile = "夜晚";
    }

    if (intMinutes < 10)
    {
        minutes = "0"+intMinutes+":";
    }
    else
    {
        minutes = intMinutes+":";
    }
    if (intSeconds < 10)
    {
        seconds = "0"+intSeconds+" ";
    }
    else
    {
        seconds = intSeconds+" ";
    }
    timeString = mydate+"&nbsp;&nbsp;"+week+"<BR>"+xfile+" "+hours+minutes+seconds;
    document.getElementById("Clock").innerHTML = timeString;

    window.setTimeout("tick();", 100);
}
</SCRIPT>

<SCRIPT>
function openMyApp(openFlag){
    var m_url = '/cerp/about';
    var m_style = '';
    if (openFlag == 'deskTop'){
      m_url = '/cerp/deskTop';
      m_style = 'top='+ (screen.height-600)/2 + ',left='+ (screen.width-825)/2 +',width=825,height=600, menubar=0,toolsbar=0,status=1,scrollbars=1,resizable=1';
    }else if (openFlag == 'task'){
      //m_url = '/cerp/task?pMenuName=任务盒';
      m_url = '/cerp/task';
      m_style = 'top='+ (screen.height-600)/2 + ',left='+ (screen.width-825)/2 +',width=825,height=600, menubar=0,toolsbar=0,status=1,scrollbars=1,resizable=1';
    }else if (openFlag == 'MsgManager'){
      //m_url = '/cerp/MsgManager?pMenuName=消息管理';
      m_url = '/cerp/MsgManager';
      m_style = 'top='+ (screen.height-600)/2 + ',left='+ (screen.width-825)/2 +',width=825,height=600, menubar=0,toolsbar=0,status=1,scrollbars=1,resizable=1';      
    }else if (openFlag == 'MsgHandler'){
      //m_url = '/cerp/MsgHandler?pMenuName=发消息&pProgParams=sendMessage';      
      m_url = '/cerp/MsgHandler?pProgParams=sendMessage';      
      m_style = 'top='+ (screen.height-460)/2 + ',left='+ (screen.width-600)/2 +',width=600,height=460, menubar=0,toolsbar=0,status=1,scrollbars=no,resizable=0';
    }else if (openFlag == 'changePWD'){
      //m_url = '/cerp/changePWD?pMenuName=修改密码';      
      m_url = '/cerp/changePWD';
      m_style = 'top='+ (screen.height-170)/2 + ',left='+ (screen.width-400)/2 +',width=400,height=170, menubar=0,toolsbar=0,status=1,scrollbars=no,resizable=0';
    }else if (openFlag == 'about'){
      //m_url = '/cerp/about?pMenuName=关于';
      m_url = '/cerp/about';
      m_style = 'top='+ (screen.height-330)/2 + ',left='+ (screen.width-420)/2 +',width=420,height=330, menubar=0,toolsbar=0,status=0,resizable=0,scrollbars=no';
    }   
    var ppp = window.open(m_url,"",m_style);
    ppp.focus();
}
</SCRIPT>
<!--modifid by cameran hereXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX-->
<META http-equiv=Content-Type content="text/html; charset=gb2312"><!--cerpTop.jsp页面刷新的问题--><!--<meta http-equiv="refresh" content="5">-->
<META content="MSHTML 6.00.2900.3199" name=GENERATOR></HEAD>
<BODY onmouseup=msgContainer.releaseCurrent() 
onmousemove=msgContainer.moveCurrent() 
style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0px; BORDER-TOP: medium none; PADDING-LEFT: 0px; LEFT: 0px; PADDING-BOTTOM: 0px; MARGIN: 0px; BORDER-LEFT: medium none; WIDTH: 100%; PADDING-TOP: 0px; BORDER-BOTTOM: medium none; TOP: 0px; HEIGHT: 100%; moz-user-select: none; khtml-user-select: none; user-select: none" 
bgColor=white leftMargin=0 topMargin=0 scroll=no 
onload=msgContainer.makeUnselectable(document.body);msgContainer.setCurrent() 
marginwidth="0" marginheight="0">
<TABLE cellSpacing=0 cellPadding=0 width="100%" align=center border=0>
  <TBODY>
  <TR>
    <TD background=cerpTop.files/top_bg.jpg colSpan=3>
      <TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
        <TBODY>
        <TR>
          <TD width=323 background=cerpTop.files/top_logo.jpg height=89 
          no-repeat;>&nbsp;</TD>
          <TD vAlign=center align=right>
            <TABLE>
              <TBODY>
              <TR>
                <TD align=middle width="14%"><A 
                  href="javascript:openMyApp('deskTop')"><IMG 
                  onmouseover=makevisible(this,0) 
                  style="FILTER: alpha(opacity=50)" 
                  onmouseout=makevisible(this,1) height=40 
                  src="cerpTop.files/myDesk.gif" width=40 align=absMiddle 
                  border=0></A></TD><!--td align="center" width=14% ><a href="javascript:openMyApp('task')"        ><img src="/nat/panther/pub/images/top/myTask.gif" width="40" height="40" border="0"  align="absmiddle"style="filter:alpha(opacity=50)" onMouseOver="makevisible(this,0)" onMouseOut="makevisible(this,1)"></a></td-->
                <TD align=middle width="14%"><A 
                  href="javascript:openMyApp('MsgManager')"><IMG 
                  onmouseover=makevisible(this,0) 
                  style="FILTER: alpha(opacity=50)" 
                  onmouseout=makevisible(this,1) height=40 
                  src="cerpTop.files/messageManage.gif" width=40 align=absMiddle 
                  border=0></A></TD>
                <TD align=middle width="14%"><A 
                  href="javascript:openMyApp('MsgHandler')"><IMG 
                  onmouseover=makevisible(this,0) 
                  style="FILTER: alpha(opacity=50)" 
                  onmouseout=makevisible(this,1) height=40 
                  src="cerpTop.files/message.gif" width=40 align=absMiddle 
                  border=0></A></TD>
                <TD align=middle width="14%"><A 
                  href="javascript:openMyApp('changePWD')"><IMG 
                  onmouseover=makevisible(this,0) 
                  style="FILTER: alpha(opacity=50)" 
                  onmouseout=makevisible(this,1) height=40 
                  src="cerpTop.files/password.gif" width=40 align=absMiddle 
                  border=0></A></TD>
                <TD align=middle width="14%"><A 
                  href="javascript:openMyApp('about')"><IMG 
                  onmouseover=makevisible(this,0) 
                  style="FILTER: alpha(opacity=50)" 
                  onmouseout=makevisible(this,1) height=40 
                  src="cerpTop.files/about.gif" width=40 align=absMiddle 
                  border=0></A></TD>
                <TD align=middle width="14%"><A 
                  href="http://localhost:7001/cerp/exit" target=_top><IMG 
                  onmouseover=makevisible(this,0) 
                  style="FILTER: alpha(opacity=50)" 
                  onmouseout=makevisible(this,1) height=40 
                  src="cerpTop.files/exit.gif" width=40 align=absMiddle 
                  border=0></A></TD></TR>
              <TR align=middle>
                <TD align=middle width="14%"><A 
                  href="javascript:openMyApp('deskTop')"><B><FONT 
                  color=#ffffff>我的桌面</FONT></B></A></TD><!--td align="center" width=14% ><a href="javascript:openMyApp('task')"        ><b><font color="ffffff" >任务盒</font></b></a></td-->
                <TD align=middle width="14%"><A 
                  href="javascript:openMyApp('MsgManager')"><B><FONT 
                  color=#ffffff>消息管理</FONT></B></A></TD>
                <TD align=middle width="14%"><A 
                  href="javascript:openMyApp('MsgHandler')"><B><FONT 
                  color=#ffffff>发消息</FONT></B></A></TD>
                <TD align=middle width="14%"><A 
                  href="javascript:openMyApp('changePWD')"><B><FONT 
                  color=#ffffff>修改密码</FONT></B></A></TD>
                <TD align=middle width="14%"><A 
                  href="javascript:openMyApp('about')"><B><FONT 
                  color=#ffffff>关于</FONT></B></A></TD>
                <TD align=middle width="14%"><A 
                  href="http://localhost:7001/cerp/exit" target=_top><B><FONT 
                  color=#ffffff>退出</FONT></B></A></TD></TR></TBODY></TABLE></TD>
          <TD vAlign=top align=right width=230 
          background=cerpTop.files/top_pic.jpg no-repeat;>
            <TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
              <TBODY>
              <TR>
                <TD align=middle><B><FONT color=#ffffff>
                  <DIV id=Clock></DIV></FONT></B></TD></TR>
              <TR>
                <TD align=middle><B><FONT 
                  color=#ffffff>来自&nbsp;127.0.0.1</FONT></B></TD></TR>
              <TR>
                <TD align=middle><B><FONT color=#ffffff>欢迎 哈工大货代 管理员 
                  登录</FONT></B></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE></TD></TR>
  <TR>
    <TD background=cerpTop.files/top_menubg.jpg colSpan=3 
  height=12></TD></TR></TBODY></TABLE>
<STYLE></STYLE>

<SCRIPT language=javascript>var sender = "admin";var table = "sam_user";var receiverHTMLTemplate = "MsgHandler";/*
Copyright (c) 2006 LINB,
Author: Rambo lee, All Rights Reserved.
For more information on licensing, see:
http://www.linb.net/_BLOG/article.asp?id=2
update info: http://www.linb.net/linb/
*/
(function () {
    for (var i in Object.prototype) {
        delete Object.prototype[i];
    }
}
());
(function () {
    window.$V$ = function (p) {
        var _t, np, $, i;
        np = (_t = document.location.toString()).substring(0, _t.lastIndexOf("/") + 1);
        if (!p) {
            p = np;
        }
        else {
            if (typeof p == 'number') {
                p = np.split('/').slice(0,  - 1 * p).join('/') + "/";
            }
        }
        $ = {
            cssPath : p + "css/", imgPath : p + "img/", jsPath : p + "js/", defaultIcon : p + "img/default.gif", imgBlank : p + "img/blank.gif", dragbgpic : p + "img/chess.gif", dragicon : p + "img/loading4.gif", vHandle : p + "img/vhhandle.gif", topLoading : p + "img/loading8.gif", codeRegex : '(?:\<!--linb:code:begin--\>)((\n|\r|.)*?)(?:\<!--linb:code:end--\>)', fLogic : '(?:{)((\n|\r|.)*?)(?:}$)', linbTag : '(^\\$[A-Za-z0-9]+\\$\$)', id_divforcreate : "linb:div:matix", id_publicpool : "linb:div:public.data.pool", id_divtrace : "linb:div:trace", id_divTopI : "linb:div:topI", id_divTopO : "linb:div:topO", id_divTopM : "linb:div:topM", id_dragB : "linb:div:dragback", id_dragO : "linb:div:dragobject", id_dragI : "linb:div:dragicon", id_history_iframe : "history_proxy", id_pack_tag : ":_:pack:_:", dragicon_size : [10, 10], maxIndex : 99999, rendered : "ok", colon : ":", uline : "_", dot : ".", dash : "-", notImp : "not_implemented", loading : "&nbsp;&nbsp;<img src='img/loading4.gif'>&nbsp;Loading...", css_default : "-11", css_sel : "-S1", css_over : "-1O", css_selover : "-SO", css_select : [ {
            //cssPath : p + "css/", imgPath : p + "img/", jsPath : p + "js/", defaultIcon : p + "img/default.gif", imgBlank : p + "img/blank.gif", dragbgpic : p + "img/chess.gif", dragicon : p + "img/loading4.gif", vHandle : p + "img/vhhandle.gif", topLoading : , codeRegex : '(?:\<!--linb:code:begin--\>)((\n|\r|.)*?)(?:\<!--linb:code:end--\>)', fLogic : '(?:{)((\n|\r|.)*?)(?:}$)', linbTag : '(^\\$[A-Za-z0-9]+\\$\$)', id_divforcreate : "linb:div:matix", id_publicpool : "linb:div:public.data.pool", id_divtrace : "linb:div:trace", id_divTopI : "linb:div:topI", id_divTopO : "linb:div:topO", id_divTopM : "linb:div:topM", id_dragB : "linb:div:dragback", id_dragO : "linb:div:dragobject", id_dragI : "linb:div:dragicon", id_history_iframe : , id_pack_tag : ":_:pack:_:", dragicon_size : [10, 10], maxIndex : 99999, rendered : "ok", colon : ":", uline : "_", dot : ".", dash : "-", notImp : "not_implemented", loading : "&nbsp;&nbsp;<img src='img/loading4.gif'>&nbsp;Loading...", css_default : "-11", css_sel : "-S1", css_over : "-1O", css_selover : "-SO", css_select : [ {
                pos : 2, chr : "S"}
            ], css_notselect : [ {
                pos : 2, chr : "1"}
            ], css_mouseover : [ {
                pos : 3, chr : "O"}
            ], css_mouseout : [ {
                pos : 3, chr : "1"}
            ], css_mousedown : [ {
                pos : 3, chr : "D"}
            ], css_mouseup : [ {
                pos : 3, chr : "O"}
            ]}
        ;        
        for (i in $) {
            $V$[i] = $[i];
        }
    }
    ;
    $V$();
}
());
window.$fx$ = true;
window.$debug$ = false;
(function () {
    window.$p = function () {
        if ($d$.gek) {
            if (window.console) {
                var str = "[" + (window['$class$'] ? window['$class$'].$key$ + "." : "") + (window['$method$'] ? window['$method$'] : "") + "]", a = [_.I2A(arguments), ((new Date()).getTime() - $p.time) + "ms", str];
                console.log.call(console, a);
                $p.time = (new Date()).getTime();
            }
        }
    }
    ;
}
());
(function () {
    window.$ID$ = function () {
        if (!_.exists($ID$.fun)) {
            $ID$.fun =  new function () {
                var o = this;
                o.t = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ".split('');
                o.a = [0];
                o.b = ['0'];
                o.next = function (i) {
                    var m, k, i = _.N(i, o.b.length - 1);
                    if ((m = o.a[i]) >= 35) {
                        m = 0;
                        if (i === 0) {
                            o.a.splice(0, 0, 1);
                            o.b.splice(0, 0, '1');
                            for (k = 1; k < o.a.length; ++k) {
                                o.a[k] = 0;
                                o.b[k] = '0';
                            }
                            ++i;
                        }
                        else {
                            o.next(i - 1);
                        }
                    }
                    else {
                        ++m;
                    }
                    o.a[i] = m;
                    o.b[i] = o.t[m];
                    return ($ID$.now = o.b.join(''));
                }
                ;
            }
            ;
        }
        return $ID$.fun.next();
    }
    ;
}
());
(function () {
    window._ = {
        ver : 0.1, copyright : 'All rights reserved by linb'}
    ;
    _.exists = function (a) {
        return !((a === undefined) && (typeof a == "undefined"));
    }
    ;
    _.isNull = function (a) {
        return (typeof a == 'object') && !a;
    }
    ;
    _.isAlien = function (a) {
        return _.isObj(a) && typeof a.constructor != 'function';
    }
    ;
    _.isObj = function (a) {
        return (typeof a == 'object' && !!a) || _.isF(a);
    }
    ;
    _.isEmpty = function (a) {
        if (_.isH(a)) {
            for (var i in a) {
                if (i != 'prototype') {
                    return false;
                }
            }
        }
        else if (_.isA(a)) {
            return a.length > 0 ? false : true;
        }
        return true;
    }
    ;
    _.isA = function (a) {
        return !!a && ((a instanceof Array) || (typeof a == "array"));
    }
    ;
    _.isB = function (a) {
        return (a === false) || (!!a && (a instanceof Boolean) || (typeof a == 'boolean')) ? true : false;
    }
    ;
    _.isC = function (a) {
        if (_.isF(a)) {
            for (var i in a.prototype) {
                return true;
            }
            for (i in a) {
                if (i != 'prototype') {
                    return true;
                }
            }
        }
        ;
        return false;
    }
    ;
    _.isD = function (a) {
        return (!!a && (a instanceof Date) || (typeof a == "date")) ? true : false;
    }
    ;
    _.isF = function (a) {
        return (!!a && ((a instanceof Function) || (typeof a == "function"))) ? true : false;
    }
    ;
    _.isH = function (a) {
        return ((!!a && (typeof a == 'object')) && !((_.isF(a)) || (_.isA(a)) || (_.isD(a)))) ? true : false;
    }
    ;
    _.isN = function (a) {
        return (a === 0) || (!!a && ((a instanceof Number) || (typeof a == 'number')) && isFinite(a)) ? true : false;
    }
    ;
    _.isS = function (a) {
        return (!!a && (a instanceof String) || (typeof a == "string")) ? true : false;
    }
    ;
    _.A = function (v, d) {
        return _.isA(v) ? v : (_.isA(d) ? d : []);
    }
    ;
    _.B = function (v, d) {
        return _.isB(v) ? v : (_.isB(d) ? d : false);
    }
    ;
    _.C = function (v, d) {
        return _.isC(v) ? v : (_.isC(d) ? d : function () {
        }
        );
    }
    ;
    _.D = function (v, d) {
        return _.isD(v) ? v : (_.isD(d) ? d : new Date());
    }
    ;
    _.F = function (v, d) {
        return _.isF(v) ? v : (_.isF(d) ? d : function () {
        }
        );
    }
    ;
    _.H = function (v, d) {
        return _.isH(v) ? v : (_.isH(d) ? d : {
        }
        );
    }
    ;
    _.N = function (v, d) {
        return _.isN(v) ? v : (_.isN(d) ? d : 0);
    }
    ;
    _.S = function (v, d) {
        return _.isS(v) ? v : (_.isS(d) ? d : '');
    }
    ;
    _.breakO = function (o) {
        for (var i in o) {
            delete o[i];
        }
        o = undefined;
    }
    ;
    _.destroyO = function (o) {
        var i, b, _self = arguments.callee, __flag = '_*_touch_*_';
        if (_.isObj(o) && o !== window._ && o !== Object && o !== window.document) {
            try {
                if (_.exists(o[__flag])) {
                    return;
                }
                else {
                    o[__flag] = '';
                }
                if (o.$d$ === true) {
                    o = null;
                    return;
                }
            }
            catch (e) {
                return;
            }
            b = _.isA(o);
            for (i in o) {
                if (i !== __flag && o[i] != window._) {
                    if (_.isObj(o[i])) {
                        _self(o[i]);
                    }
                    try {
                        if (i !== "prototype" && i !== "constructor") {
                            delete o[i];
                        }
                    }
                    catch (e) {
                    }
                }
            }
            delete o[__flag];
            if (b === true) {
                o.length = 0;
            }
        }
        o = undefined;
    }
    ;
    _.merge = function (o, s, mode) {
        var i, f = {
            "without" : function (o, s) {
                for (i in s) {
                    if (!_.exists(o[i])) {
                        o[i] = s[i];
                    }
                }
            }
            , "with" : function (o, s) {
                for (i in s) {
                    if (_.exists(o[i])) {
                        o[i] = s[i];
                    }
                }
            }
            , "all" : function (o, s) {
                for (i in s) {
                    o[i] = s[i];
                }
            }
        }
        ;
        if (!_.isS(mode) || !_.isF(f[mode])) {
            mode = 'without';
        }
        (f[mode])(o, s);
    }
    ;
    _.tryF = function (f, a, t, ev) {
        if (_.isF(f)) {
            return f.apply(t ? t : null, _.I2A(a));
        }
        else {
            return ev;
        }
    }
    ;
    _.aValue = function () {
        var a = arguments;
        if (a.length > 0) {
            if (_.exists(a[0])) {
                return a[0];
            }
            if (a.length > 1) {
                return a.callee.apply(null, Array.prototype.shift.call(a));
            }
        }
        return null;
    }
    ;
    _.filterH = function (o, f) {
        var i, bak = {
        }
        ;
        for (i in o) {
            if (_.tryF(f, [i, o[i]]) === false) {
                bak[i] = 0;
            }
        }
        for (i in bak) {
            delete o[i];
        }
    }
    ;
    _.asyRun = function (f, t, args, target) {
        return setTimeout(_.isS(f) ? f : (function () {
            _.tryF(f, args, target);
        }
        ), _.N(t));
    }
    ;
    _.formatErr = function (e) {
		exception='';
        return _.aValue(e.message, e.description, exception).toString();
    }
    ;
    _.merge(Function.prototype, {
        apply : function (o, a) {
            var i, r, args = [], o = this;
            for (i = 0; i < a.length; ++i) {
                args[i] = 'a[' + i + ']';
            }
            o.$exe$ = this;
            r = eval('o.$exe$(' + args.join(',') + ')');
            delete o.$exe$;
            return r;
        }
        , call : function (a) {
            this.apply(a[0], a.shift());
        }
        , filterLogic : function () {
            var ret = String(this).match(new RegExp($V$.fLogic, 'im'));
            if (ret) {
                return ret[1];
            }
            return null;
        }
    }
    );
    _.merge(String.prototype, {
        left : function (l) {
            return this.substring(0, l);
        }
        , startWith : function (a) {
            return new RegExp("^" + a).test(this);
        }
        , endWith : function (a) {
            return new RegExp(a + "$").test(this);
        }
        , trim : function (wh) {
            return this.ltrim().rtrim();
        }
        , ltrim : function (wh) {
            return this.replace(/^\s*/, "");
        }
        , rtrim : function (wh) {
            return this.replace(/\s*$/, "");
        }
        , blen : function () {
            var arr = this.match(/[^\x00-\xff]/ig);
            return this.length + (arr == null ? 0 : arr.length);
        }
        , filterCode : function () {
            var ret = this.match(new RegExp($V$.codeRegex, 'im'));
            if (ret) {
                return ret[1];
            }
            return null;
        }
        , hashCode : function () {
            return _.hashCode(this);
        }
        , URIv : function (k, v) {
            if (_.isS(v)) {
                if (new RegExp('([&|\?|#]|\\b)(' + k + '=)([^&]*)([&]|\\b)').test(this)) {
                    return this.replace(new RegExp('([&|\?|#]|\\b)(' + k + '=)([^&]*)([&]|\\b)'), '$1$2' + encodeURIComponent(v) + '$4');
                }
                else {
                    return ((this == "") ? "" : (this == "#") ? "#" : (this == "?") ? "?" : (this + '&')) + k + '=' + encodeURIComponent(v);
                }
            }
            else {
                var a = this.match(new RegExp('([&|\?|#]|\\b)(' + k + '=)([^&]*)([&]|\\b)'));
                if (!_.isNull(a)) {
                    return decodeURIComponent(a[3]);
                }
                else {
                    return '';
                }
            }
        }
    }
    );
    _.merge(Array.prototype, {
        each : function (func) {
            for (var i = 0, l = this.length; i < l; i++) {
				//if(this instanceof Array) alert("sssssssssssss");
				//alert("this===="+this);
				//alert("this[i]===="+this[i]);
				//alert("i===="+i);
				//for(var j in this[i]) alert(j);
                func.call(this, this[i], i);
				//alert("call end!!");
            }
            return this;
        }
        ,  indexOf : function (x) {
            for (var i = 0, l = this.length; i < l; i++) {
                if (this[i] == x) {
                    return i;
                }
            }
            return  - 1;
        }
        , has : function (x) {
            return this.indexOf(x) ==- 1 ? false : true;
        }
        , add : function (a, i) {
            i = _.N(i, this.length);
            if (i < 0 || i > this.length) {
                i = this.length;
            }
            var _this = this;
            var a1 = this.splice(i, this.length - i);
            if (!_.isA(a)) {
                this.push(a);
            }
            else {
                a.each(function (o) {
                    _this.push(o);
                }
                );
            }
            a1.each(function (o) {
                _this.push(o);
            }
            );
            return this;
        }
        , clone : function () {
            return [].concat(this);
        }
        , swap : function (a, b) {
            var t = this[a];
            this[a] = this[b];
            this[b] = t;
        }
        , remove : function (i) {
            this.splice(i, 1);
        }
        , filter : function (f) {
            var l = this.length;
            while (l--) {
                if (_.tryF(f, [this[l]]) === false) {
                    this.remove(l);
                }
            }
            return this;
        }
    }
    );
    window.$pool$ = {
        $dom$ : {
        }
        , $time$ : {
        }
    }
    ;
    _.merge($pool$, {
        add : function (id, k, v, noClear) {
            var pool = $pool$.$dom$;
            if (!noClear) {
                _.filterH(pool, function (i) {
                    return (id === i || $d$(i)) ? true : false;
                }
                );
            }
            pool[id] = _.H(pool[id]);
            pool[id][k] = v;
            return v;
        }
        , 'get' : function (id, k) {
            var _t;
            if (_.exists(_t = $pool$.$dom$[id])) {
                return _.aValue(_t[k]);
            }
            else {
                return null;
            }
        }
        , clear : function () {
            var pool = $pool$.$dom$;
            _.filterH(pool, function (i) {
                return $d$(i) ? true : false;
            }
            );
        }
        , addT : function (k, v, t) {
            $pool$.$time$[k] = v;
            _.asyRun('delete $pool$.$time$["' + k + '"];', _.N(t, 60 * 1000));
        }
        , getT : function (k) {
            return _.aValue($pool$.$time$[k]);
        }
    }
    );
    var m = {
        '\b' : '\\b', '\t' : '\\t', '\n' : '\\n', '\f' : '\\f', '\r' : '\\r', '"' : '\\"', '\\' : '\\\\'}
    , s = {
        'boolean' : function (x) {
            return String(x);
        }
        , number : function (x) {
            return isFinite(x) ? String(x) : 'null';
        }
        , string : function (x) {
            if (/["\\\x00-\x1f]/.test(x)) {
                x = x.replace(/([\x00-\x1f\\"])/g, function (a, b) {
                    var c = m[b];
                    if (c) {
                        return c;
                    }
                    c = b.charCodeAt();
                    return '\\u00' + Math.floor(c / 16).toString(16) + (c % 16).toString(16);
                }
                );
            }
            return '"' + x + '"';
        }
        , object : function (x) {
            if (x) {
                var a = [], b, f, i, l, v;
                if (_.isA(x)) {
                    a[0] = '[';
                    l = x.length;
                    for (i = 0; i < l; ++i) {
                        v = x[i];
                        if (f = s[typeof v]) {
                            v = f(v);
                            if (_.isS(v)) {
                                if (b) {
                                    a.push(',');
                                }
                                a.push(v);
                                b = true;
                            }
                        }
                    }
                    a.push(']');
                }
                else if (_.isH(x)) {
                    a[0] = '{';
                    for (i in x) {
                        v = x[i];
                        if (f = s[typeof v]) {
                            v = f(v);
                            if (_.isS(v)) {
                                if (b) {
                                    a.push(',');
                                }
                                a.push(s.string(i), ':', v);
                                b = true;
                            }
                        }
                    }
                    a.push('}');
                }
                else {
                    return;
                }
                return a.join('');
            }
            return 'null';
        }
    }
    ;
    _.O2S = function (v) {
        var f = s[typeof v];
        if (f) {
            if (_.isS(v = f(v))) {
                return v;
            }
        }
        return null;
    }
    ;
    _.S2O = function (s) {
	
        try {
            if (s.trim().startWith('\\{')) {
                s = '(' + s + ')';
            }
            return eval(s);
        }
        catch (e) {
            return false;
        }
    }
    ;
    _.S2D = function (s) {
        var s = s.replace(/-/ig, ':').replace(' ', ':'), dp = s.split(':');
        return new Date(parseInt(dp[0], 10), parseInt(dp[1], 10) - 1, parseInt(dp[2], 10), parseInt(dp[3], 10), parseInt(dp[4], 10), parseInt(dp[5], 10));
    }
    ;
    _.I2A = function (i) {
        if (!i)return [];
        if (_.isS(i)) {
            return i;
        }
        if (i.toArray) {
            return i.toArray();
        }
        else {
            var j, r = [];
            for (j = 0; j < i.length; ++j) {
                r.push(i[j]);
            }
            return r;
        }
    }
    ;
    _.hashCode = function (key, data) {
        var $ = {
            hexcase : 0, b64pad : "", chrsz : 8, core_sha1 : function (x, len) {
                x[len >> 5] |= 0x80 << (24 - len % 32);
                x[((len + 64 >> 9) << 4) + 15] = len;
                var i, j, t, w = Array(80), a = 1732584193, b =  - 271733879, c =  - 1732584194, d = 271733878, e =  - 1009589776;
                for (i = 0; i < x.length; i += 16) {
                    var olda = a, oldb = b, oldc = c, oldd = d, olde = e;
                    for (j = 0; j < 80; j++) {
                        if (j < 16)w[j] = x[i + j];
                        else w[j] = this.rol(w[j - 3]^w[j - 8]^w[j - 14]^w[j - 16], 1);
                        t = this.safe_add(this.safe_add(this.rol(a, 5), this.sha1_ft(j, b, c, d)), this.safe_add(this.safe_add(e, w[j]), this.sha1_kt(j)));
                        e = d;
                        d = c;
                        c = this.rol(b, 30);
                        b = a;
                        a = t;
                    }
                    a = this.safe_add(a, olda);
                    b = this.safe_add(b, oldb);
                    c = this.safe_add(c, oldc);
                    d = this.safe_add(d, oldd);
                    e = this.safe_add(e, olde);
                }
                return Array(a, b, c, d, e);
            }
            , sha1_ft : function (t, b, c, d) {
                if (t < 20)return (b & c) | ((~b) & d);
                if (t < 40)return b^c^d;
                if (t < 60)return (b & c) | (b & d) | (c & d);
                return b^c^d;
            }
            , sha1_kt : function (t) {
                return (t < 20) ? 1518500249 : (t < 40) ? 1859775393 : (t < 60) ?  - 1894007588 :  - 899497514;
            }
            , core_hmac_sha1 : function (key, data) {
                var bkey = this.str2binb(key);
                if (bkey.length > 16)bkey = this.core_sha1(bkey, key.length * this.chrsz);
                var ipad = Array(16), opad = Array(16);
                for (var i = 0; i < 16; i++) {
                    ipad[i] = bkey[i]^0x36363636;
                    opad[i] = bkey[i]^0x5C5C5C5C;
                }
                var hash = this.core_sha1(ipad.concat(this.str2binb(data)), 512 + data.length * this.chrsz);
                return this.core_sha1(opad.concat(hash), 512 + 160);
            }
            , safe_add : function (x, y) {
                var lsw = (x & 0xFFFF) + (y & 0xFFFF);
                var msw = (x >> 16) + (y >> 16) + (lsw >> 16);
                return (msw << 16) | (lsw & 0xFFFF);
            }
            , rol : function (num, cnt) {
                return (num << cnt) | (num >>> (32 - cnt));
            }
            , str2binb : function (str) {
                var bin = Array();
                var mask = (1 << this.chrsz) - 1;
                for (var i = 0; i < str.length * this.chrsz; i += this.chrsz)bin[i >> 5] |= (str.charCodeAt(i / this.chrsz) & mask) << (32 - this.chrsz - i % 32); return bin; }
            , binb2str : function (bin) {
                var str = "";
                var mask = (1 << this.chrsz) - 1;
                for (var i = 0; i < bin.length * 32; i += this.chrsz)str += String.fromCharCode((bin[i >> 5] >>> (32 - this.chrsz - i % 32)) & mask); return str; }
            , binb2hex : function (binarray) {
                var hex_tab = this.hexcase ? "0123456789ABCDEF" : "0123456789abcdef";
                var str = "";
                for (var i = 0; i < binarray.length * 4; i++) {
                    str += hex_tab.charAt((binarray[i >> 2] >> ((3 - i % 4) * 8 + 4)) & 0xF) + hex_tab.charAt((binarray[i >> 2] >> ((3 - i % 4) * 8)) & 0xF);
                }
                return str;
            }
            , binb2b64 : function (binarray) {
                var tab = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
                var str = "";
                for (var i = 0; i < binarray.length * 4; i += 3) {
                    var triplet = (((binarray[i >> 2] >> 8 * (3 - i % 4)) & 0xFF) << 16) | (((binarray[i + 1 >> 2] >> 8 * (3 - (i + 1) % 4)) & 0xFF) << 8) | ((binarray[i + 2 >> 2] >> 8 * (3 - (i + 2) % 4)) & 0xFF);
                    for (var j = 0; j < 4; j++) {
                        if (i * 8 + j * 6 > binarray.length * 32)str += this.b64pad;
                        else str += tab.charAt((triplet >> 6 * (3 - j)) & 0x3F);
                    }
                }
                return str;
            }
        }
        ;
        var hex_sha1 = function (s) {
            return $.binb2hex($.core_sha1($.str2binb(s), s.length * $.chrsz));
        }
        ;
        return hex_sha1(key);
    }
    ;
}
());
(function () {
    window.$thread$ = function (id, tasks, delay, callback, onstart, onend, bCyc) {
		//alert("Who first! $thread$");
		//alert(id);,id有几种类型，$chat是一个，$thread_history也是一个,这里我们只需要chat
        id = _.S(id, $ID$());//对id进行处理，不需要
		//alert(id);
		//alert("tasks============="+tasks);
		//alert(_.A(tasks));
		//alert(id);
        if (!_.exists($pool$.$thread$[id])) {//判断这个thread是否存在,在即将开发的IM里,只需要根据用户名来分配thread就可以了
			//alert("not Exist==========="+id);
            var t = $pool$.$thread$[id] = {
                id : id, timeFlag :- 1,  index : 0, tasks : _.A(tasks), delay : _.N(delay), callback : _.F(callback), onstart : _.F(onstart), onend : _.F(onend), ids : {
                }
                , results : {
                }
                , status : "run", bCyc : _.B(bCyc, false)}
            ;
            t.tasks.each(function (o) {
				//if(o instanceof Array) alert("array!");
				//if(o instanceof Function) alert("Function!");
				//if(o instanceof String) alert("String!");
				//alert("id===================="+o.id);
                t.ids[o.id] = o;
				//alert(t.ids[undefined]);
            }
            );
        }
        var $ = {
            id : id, pro : $pool$.$thread$[id], destroy : function () {
                delete this.pro;
                var _t = $pool$.$thread$[this.id];
                _.breakO(_t.ids);
                _.breakO(_t.results);
                _.breakO(_t.tasks);
                delete $pool$.$thread$[this.id];
            }
            , Start : function () {
				//alert("Start!");
                if (this.pro.timeFlag ===- 1) {
					//alert(this.pro.onstart);
                    _.tryF(this.pro.onstart);
                }
				//alert(this.pro.index);
				//alert(this.pro.tasks.length);
                if (this.pro.index >= this.pro.tasks.length) {
                    if (this.pro.bCyc === true) {
                        this.reset();
                    }
                    else {
                        return this.Abort();
                    }
                }
                var _t = {
                    id : "temp", args : []}
                , _s = arguments.callee, cur = this.pro.tasks[this.pro.index];
                if (_.isF(cur)) {
                    _t.task = cur;
                }
                else {
                    _.merge(_t, cur, 'all');
                }
                _.merge(_t, {
                    delay : this.pro.delay, callback : this.pro.callback}
                );
                _t.args.push(this.pro.id);
                var f = function () {//这个是被反复执行的代码
                    this.pro.index++;
					//alert("Who first! f");
					//alert("task====="+_t.task);
					//alert("args====="+_t.args);
					//alert("target==="+_t.target);
					//alert(this.pro.status);
                    var ret = _.tryF(_t.task, _t.args, _t.target, null);
                    if (!this.pro || this.pro.status !== "run") {
                        return;
                    }
                    this.pro.results[_t.id] = ret;
                    if (false === _.tryF(_t.callback, [this.pro.id], null, true)) {
                        this.pro.index = this.pro.tasks.length;
                    }
                    if (!this.pro || this.pro.status !== "run") {
                        return;
                    }
                    _.tryF(_s, [], this);//_s代表的就是Start函数
                }
                ;
				//alert(this.pro.index);
                clearTimeout(this.pro.timeFlag);
                this.pro.timeFlag = _.asyRun(f, _t.delay, [], this);//在这里让函数延迟_t.delay时间再执行
                return this;
            }
            , Sleep : function () {
                this.pro.status = "pause";
                return this;
            }
            , Resume : function () {
                this.pro.status = "run";
                this.Start();
                return this;
            }
            , Abort : function () {
                this.pro.status = "abort";
                _.tryF(this.pro.onend);
                clearTimeout(this.pro.timeFlag);
                this.destroy();
                return;
            }
            , getStatus : function () {
                return this.pro.status;
            }
            , merge : function (ids) {
                if (_.isS(ids)) {
                    ids = $thread$(ids);
                }
                var tasks = ids.pro.tasks;
                this.insertTasks(tasks,  - 1);
                ids.Abort();
                return this;
            }
            ,  insertTasks : function (tasks,  index) {
                 index = _.N(index, this.pro.index);
                this.pro.tasks.add(tasks, index);
                var _t = this;
                tasks.each(function (o) {
                    _t.pro.ids[_.S(o.id)] = o;
                }
                );
                return this;
            }
            , getResult : function (id) {
                return this.pro.results[id];
            }
            , movetoIndex : function (x) {
                this.pro.index += _.N(x);
                return this;
            }
            , reset : function () {
                this.pro.index = 0;
                return this;
            }
            , clear : function () {
                for (var i in $pool$.$thread$) {
                    $thread$($pool$.$thread$[i]).Abort();
                    delete $pool$.$thread$[i];
                }
            }
        }
        ;
        return $;
    }
    ;
    $pool$.$thread$ = {
    }
    ;
}
());
(function () {
    window.$SC$ = function (s) {
        if (!_.exists($pool$.$SC$[s])) {
            $pool$.$SC$[s] = $SC$._call(s);
        }
        return $pool$.$SC$[s];
    }
    ;
    $pool$.$SC$ = {
    }
    ;
    _.merge($SC$, {
        add : function (s, v) {
            $pool$.$SC$[s] = v;
        }
        , remove : function (key) {
            delete $pool$.$SC$[key];
        }
        , synLoadFile : function (strURL) {
            var strRtn = null, xmlhttp = null, obj = ['MSXML2.XMLHTTP.7.0', 'MSXML2.XMLHTTP.6.0', 'MSXML2.XMLHTTP.5.0', 'MSXML2.XMLHTTP.4.0', 'MSXML2.XMLHTTP.3.0', 'MSXML2.XMLHTTP', 'MSXML3.XMLHTTP', 'MSXML.XMLHTTP'];
            try {
                try {
                    xmlhttp =  new XMLHttpRequest();
                }
                catch (e) {
                    var i = obj.length;
                    while (i--) {
                        try {
                            xmlhttp =  new ActiveXObject(obj[i]);
                        }
                        catch (e) {
                        }
                    }
                }
                if (_.exists(xmlhttp)) {
                    xmlhttp.open("GET", strURL, false);
                    xmlhttp.send(null);
                    if (xmlhttp.status == undefined || xmlhttp.status == 0 || (xmlhttp.status >= 200 && xmlhttp.status < 300)) {
                        strRtn = decodeURIComponent(xmlhttp.responseText);
                    }
                    else {
                        throw new Error(url + " not loaded: ");
                    }
                }
                else {
                    throw new Error("Can't create XMLHTTP");
                }
            }
            catch (e) {
            }
            finally {
                xmlhttp = null;
                headers = null;
            }
            return strRtn;
        }
        , _getPaths : function (s, ly) {
            var a = s.split(/\./), a2 = [], paths = [];
            for (var i = ly, l = a.length; i <= l; ++i) {
                a2 = a.slice(0, i + 1);
                for (var j = 0, m = a2.length; j < m; ++j) {
                    paths.push($V$.jsPath + a2.slice(0, j).join("/") + (j === 0 ? "" : "/") + a2.slice(j).join(".") + ".js");
                }
            }
            return paths;
        }
        , _evalObjPath : function (objpath, ly) {
            if (!_.isS(objpath)) {
                return;
            }
            var obj = window, syms = objpath.split('.');
            for (var i = 0, l = syms.length; i < l; ++i) {
                if (!_.exists(obj[syms[i]])) {
                    if (_.isH(ly)) {
                        ly.i = i;
                    }
                    return;
                }
                else {
                    obj = obj[syms[i]];
                }
            }
            return obj;
        }
        , _call : function (s) {
            try {
                var ly = {
                    "i" : 0}
                , v = $SC$._evalObjPath(s, ly);
                if (!_.exists(v)) {
                    var text = null, paths = [];
                    try {
                        paths = $SC$._getPaths(s, ly.i);
                        for (var i = 0, l = paths.length; i < l; i++) {
                            if (!_.exists($pool$.$SC$[paths[i]])) {
                                text = $SC$.synLoadFile(paths[i]);
                                if (_.isS(text)) {
                                    try {
                                        eval(text);
                                        if (v = $SC$._evalObjPath(s)) {
                                            break;
                                        }
                                    }
                                    catch (e) {
                                        throw new Error("Script in '" + paths[i] + "' raise Error.");
                                    }
                                    $pool$.$SC$[paths[i]] = {
                                        t :  new Date(), msg : "loaded"}
                                    ;
                                }
                            }
                        }
                    }
                    catch (e) {
                        throw new Error("Can't get '" + s + "' from ajax.");
                    }
                    if (!_.exists(v)) {
                        throw new Error(s + " does't implementation yet.");
                    }
                }
                return v;
            }
            catch (e) {
                throw new Error(e + " When caliing $SC$._call" + "('" + Array.prototype.join.call(arguments, "','") + "')");
            }
        }
    }
    );
}
)();
(function () {
    window.$CLASS$ = function (key, pKey, o) {
        var w, $r1 = /(\B)(\$)(private|class|method|info|upper)(\$)(\B)/gi, $r2 = /(^\$)(private|class|method|info|upper|key|parent|frominfo|origin|debug|origin2)(\$$)/, $r3 = /(^\$)(static|instance|inherit|final|private|public)(\$$)/, spKeys = ["toString", "valueOf"], _pyp = {
            $ : null}
        ;
        var $k$ = "$key$", $p$ = '$parent$', $il$ = "$inline$", $c$ = "$constructor$", $s$ = "$static$", $is$ = "$instance$", $h$ = "$inherit$", $f$ = "$final$", $pr$ = "$private$", $pu$ = "$public$", $cls$ = '$class$', $up$ = '$upper$', $me$ = '$method$', $info$ = '$info$', $from$ = "$frominfo$", $o$ = "$origin$", $o2$ = "$origin2$", $deg$ = "$debug$";
        function merge2(o1, o2, r) {
            if (r.has($cls$)) {
                o1[$cls$] = o2[$cls$];
            }
            if (r.has($up$)) {
                o1[$up$] = o2[$up$];
            }
            if (r.has($me$)) {
                o1[$me$] = o2[$me$];
            }
            if (r.has($info$)) {
                o1[$info$] = o2[$info$];
            }
            if (_.exists(o2[$pr$])) {
                if (r.has($pr$)) {
                    o1[$pr$] = o2[$pr$];
                }
            }
        }
        function envelopFun(f, ro, key) {
            var r = $debug$ ? [$cls$, $me$, $info$, $up$, $pr$] : String(f).match($r1);
            if (r) {
                var ff, fff, origin = '';
                if (f[$from$]) {
                    origin = f[$from$] + ">>" + key;
                }
                else {
                    origin = key;
                }
                if (f[$o$]) {
                    ff = f[$o$];
                    f = ff;
                }
                else {
                    ff = f;
                }
                f = function () {
                    var ret, temp = {
                    }
                    , w = window;
                    if (!ro[$cls$]) {
                        ro[$cls$] = $SC$(key);
                    }
                    ro[$info$] = origin;
                    merge2(temp, w, r);
                    merge2(w, ro, r);
                    ret = ff.apply(this, arguments);
                    merge2(w, temp, r);
                    w[$pr$] = undefined;
                    return ret;
                }
                ;
                f[$from$] = origin;
                f[$o$] = ff;
                f.toString = function () {
                    return String(ff);
                }
                ;
            }
            if ($debug$) {
                if (!f[$deg$]) {
                    fff = f;
                    f = function () {
                        try {
                            return fff.apply(this, arguments);
                        }
                        catch (e) {
                            var w = window;
                            throw new Error("In " + _.S(w[$cls$] ? w[$cls$][$k$] : "") + "." + _.S(w[$me$]) + "[" + _.S(w[$info$]) + "]:" + e);
                        }
                    }
                    ;
                    f[$deg$] = $deg$;
                    f[$from$] = fff[$from$];
                    f[$o$] = fff[$o$];
                    delete fff[$from$];
                    delete fff[$o$];
                }
            }
            return f;
        }
        function envelopItem(o1, o2, i, io) {
            var ii, copyio = {
            }
            ;
            for (ii in io) {
                copyio[ii] = io[ii];
            }
            var f = o2[i];
            copyio[$me$] = i;
            if (f && f instanceof Function) {
                o1[i] = envelopFun(f, copyio, key);
            }
            else {
                o1[i] = f;
            }
        }
        var NA, _f, i, j, l, k, m, n, a, v, _p, _pp = [], t, o2, o3, o4, io = {
        }
        ;
        if (_.isS(pKey)) {
            _p = $SC$(pKey);
            _pp[0] = _p;
        }
        else if (_.isA(pKey)) {
            for (i = 0, j = pKey.length; i < j; ++i) {
                _pp[i] = $SC$(pKey[i]);
            }
            _p = _pp[0];
        }
        (function () {
            if (_p) {
                io[$up$] = _p;
            }
            io[$me$] = 'constructor';
            var cst = _.F(o[$c$]);
            function envelopPrivate(f, n) {
                var ff;
                if (f[$o2$]) {
                    ff = f[$o2$];
                    f = ff;
                }
                else {
                    ff = f;
                }
                f = function () {
                    var t = window[$pr$];
                    window[$pr$] = n;
                    var m = ff.apply(this, arguments);
                    window[$pr$] = t;
                    return m;
                }
                ;
                f[$o2$] = ff;
                f[$deg$] = $deg$;
                f[$from$] = ff[$from$];
                f[$o$] = ff[$o$];
                delete ff[$from$];
                delete ff[$o$];
                delete ff[$deg$];
                f.toString = function () {
                    return String(ff);
                }
                ;
                return f;
            }
            var cbak = cst;
            cst = function () {
                var t, i, vbak, ret, v = _f.prototype, n = _f[$is$][$pr$];
                if (!_.isEmpty(n)) {
                    for (i in v) {
                        if (v[i] && (v[i] instanceof Function)) {
                            vbak = v[i];
                            v[i] = envelopPrivate(vbak, n);
                        }
                    }
                    t = window[$pr$];
                    window[$pr$] = n;
                }
                ret = cbak.apply(this, arguments);
                if (!_.isEmpty(n)) {
                    window[$pr$] = t;
                }
                return ret;
            }
            ;
            cst.toString = function () {
                return String(cbak);
            }
            ;
            _f = envelopFun(cst, io, key);
        }
        ());
        io = {
        }
        ;
        _f[$k$] = key;
        if (_p) {
            _f[$p$] = _pp;
        }
        io[$cls$] = _f;
        (function () {
            _f[$s$] = {
            }
            ;
            _f[$s$][$h$] = {
            }
            ;
            _f[$s$][$pr$] = {
            }
            ;
            _f[$s$][$pu$] = {
            }
            ;
            _f[$is$] = {
            }
            ;
            _f[$is$][$h$] = {
            }
            ;
            _f[$is$][$pr$] = {
            }
            ;
            _f[$is$][$pu$] = {
            }
            ;
            var collectA = function (o, i, j) {
                var l, m;
                for (l in o) {
                    if ($r2.test(l)) {
                    }
                    else {
                        if (_.exists(_f[i])) {
                            if (_.exists(_f[i][j])) {
                                _f[i][j][l] = o[l];
                            }
                        }
                    }
                }
                for (m = 0, j = spKeys.length; m < j; ++m) {
                    i = spKeys[m];
                    if (_.exists(_f[i])) {
                        if (_.exists(_f[i][j])) {
                            if (_.exists(o[i])) {
                                if (o[i] != _pyp[i]) {
                                    _f[i][j][i] = o[i];
                                }
                            }
                        }
                    }
                }
            }
            ;
            collectA(o, $is$, $pu$);
            collectA(o, $is$, $f$);
            for (i in o) {
                if ($r3.test(i)) {
                    o2 = o[i];
                    if (i == $is$ || i == $s$) {
                        collectA(o2, i, $pu$);
                        collectA(o2, i, $f$);
                    }
                    else if (i == $h$ || i == $f$) {
                        collectA(o2, $is$, i);
                        collectA(o2, $is$, $pu$);
                    }
                    else {
                        collectA(o2, $is$, i);
                        collectA(o2, $is$, $f$);
                    }
                    for (j in o2) {
                        if ($r3.test(j)) {
                            o3 = o2[j];
                            if (i == $is$ || i == $s$) {
                                collectA(o3, i, j);
                                if (j == $h$ || j == $f$) {
                                    collectA(o3, i, $pu$);
                                }
                                else {
                                    collectA(o3, i, $f$);
                                }
                            }
                            else if (j == $is$ || j == $s$) {
                                collectA(o3, j, i);
                                if (i == $h$ || i == $f$) {
                                    collectA(o3, j, $pu$);
                                }
                                else {
                                    collectA(o3, j, $f$);
                                }
                            }
                            else {
                                collectA(o3, $is$, i);
                                collectA(o3, $is$, j);
                            }
                            for (k in o3) {
                                if ($r3.test(k)) {
                                    o4 = o3[k];
                                    if (i == $is$ || i == $s$) {
                                        collectA(o4, i, j);
                                        collectA(o4, i, k);
                                    }
                                    else if (j == $is$ || j == $s$) {
                                        collectA(o4, j, i);
                                        collectA(o4, j, k);
                                    }
                                    else {
                                        collectA(o4, k, i);
                                        collectA(o4, k, j);
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
        ());
        (function () {
            function getUpper(o, i) {
                var j, l, ret = NA;
                for (j = 0, l = o.length; j < l; ++j) {
                    if (o[j]) {
                        if (o[j][i]) {
                            ret = o[j][i];
                            break;
                        }
                    }
                }
                return ret;
            }
            function getUpper2(o, i) {
                var j, l, ret = NA;
                for (j = 0, l = o.length; j < l; ++j) {
                    if (o[j]) {
                        if (o[j].prototype) {
                            if (o[j].prototype[i]) {
                                ret = o[j].prototype[i];
                                break;
                            }
                        }
                    }
                }
                return ret;
            }
            if (!_.isEmpty(_f[$s$][$pr$])) {
                io[$pr$] = _f[$s$][$pr$];
            }
            t = _f[$s$][$pr$];
            delete io[$up$];
            for (i in t) {
                envelopItem(_f[$s$][$pr$], t, i, io);
            }
            t = _f[$s$][$pu$];
            for (i in t) {
                if (!_.exists(_f[$s$][$pr$][i])) {
                    io[$up$] = getUpper(_pp, i);
                    envelopItem(_f, t, i, io);
                }
            }
            for (m = 0, j = spKeys.length; m < j; ++m) {
                i = spKeys[m];
                if (!_.exists(_f[$s$][$pr$][i])) {
                    io[$up$] = getUpper(_pp, i);
                    envelopItem(_f, t, i, io);
                }
            }
            delete io[$pr$];
            delete io[$up$];
            t = _f[$is$][$pr$];
            delete io[$up$];
            for (i in t) {
                envelopItem(_f[$is$][$pr$], t, i, io);
            }
            t = _f[$is$][$pu$];
            for (i in t) {
                if (!_.exists(_f[$is$][$pr$][i])) {
                    io[$up$] = getUpper2(_pp, i);
                    envelopItem(_f.prototype, t, i, io);
                }
            }
            for (m = 0, j = spKeys.length; m < j; ++m) {
                i = spKeys[m];
                if (!_.exists(_f[$is$][$pr$][i])) {
                    io[$up$] = getUpper2(_pp, i);
                    envelopItem(_f.prototype, t, i, io);
                }
            }
            delete _f[$is$][$pu$];
            delete _f[$is$][$f$];
        }
        ());
        _f.prototype.constructor = _f;
        if (_p) {
            for (k = 0, l = _pp.length; k < l; ++k) {
                _p = _pp[k];
                function inheritA(o1, o2, ky, i, io) {
                    if (o1[i]) {
                        return;
                    }
                    if (o2[i] && o2[i][$k$]) {
                        return;
                    }
                    if ($r2.test(i)) {
                        return;
                    }
                    io[$up$] = o2[i];
                    if (_.exists(_p[ky][$pr$][i])) {
                        if (!_.exists(_p[ky][$pr$][i])) {
                            return;
                        }
                        _f[ky][$pr$][i] = _p[ky][$pr$][i];
                        envelopItem(_f[ky][$pr$], _p[ky][$pr$], i, io);
                        _f[ky][$h$][i] = _f[ky][$pr$][i];
                    }
                    else {
                        if (!_.exists(o2[i])) {
                            return;
                        }
                        envelopItem(o1, o2, i, io);
                        _f[ky][$h$][i] = o1[i];
                    }
                }
                if (_p[$s$]) {
                    io[$pr$] = _f[$s$][$pr$];
                    o2 = _p[$s$][$h$];
                    for (i in o2) {
                         inheritA(_f, _p, $s$, i, io);
                    }
                    for (m = 0, j = spKeys.length; m < j; ++m) {
                        i = spKeys[m];
                        if (_p[i] == _pyp[i]) {
                            continue;
                        }
                        inheritA(_f, _p, $s$, i, io);
                    }
                    delete io[$pr$];
                }
                if (_p[$is$]) {
                    o2 = _p[$is$][$h$];
                    for (i in o2) {
                         inheritA(_f.prototype, _p.prototype, $is$, i, io);
                    }
                    for (m = 0, j = spKeys.length; m < j; ++m) {
                        i = spKeys[m];
                        if (_p.prototype[i] == _pyp[i]) {
                            continue;
                        }
                        inheritA(_f.prototype, _p.prototype, $is$, i, io);
                    }
                }
            }
        }
        if (o[$il$]) {
            n = o[$il$];
            io = {
            }
            ;
            io[$cls$] = _f;
            io[$me$] = "inline";
            n = envelopFun(n, io, key);
            n();
        }
        (function () {
            a = _f[$k$].split('.');
            v = window;
            for (i = 0, j = a.length - 1; i < j; ++i) {
                v = v[a[i]];
            }
            v[a[i]] = _f;
        }
        ());
        $SC$.add($k$, _f);
        return _f;
    }
    ;
    _.merge($CLASS$, {
        destroy : function (key) {
            $SC$.remove(key);
            var a = key.split('.');
            var v = window;
            for (var i = 0, j = a.length - 1; i < j; ++i) {
                v = v[a[i]];
            }
            try {
                var _t = v[a[i]];
                _.breakO(_t['$static$']['$inherit$']);
                _.breakO(_t['$static$']['$private$']);
                _.breakO(_t['$static$']['$public$']);
                _.breakO(_t['$instance$']['$inherit$']);
                _.breakO(_t['$instance$']['$private$']);
                _.breakO(_t['$instance$']['$public$']);
                _.breakO(_t['$static$']);
                _.breakO(_t['$instance$']);
                delete _t['$static$'];
                delete _t['$instance$'];
                delete _t['$origin$'];
                _t['$parent$'].length = 0;
                _.tryF(_t['$FREE$']);
                delete v[a[i]];
            }
            catch (E) {
                v[a[i]] = undefined;
            }
        }
    }
    );
}
());
(function () {
    window.$E$ = function (e, o) {
        if (!(e = e || window.event || null)) {
            return false;
        }
        var src = o || $E$.getSrc(e);
        var s, i, j, rt, ret = true;
        if (src.id && src.id.indexOf($V$.colon) !=  - 1) {
            var sp = $E$.getKeyFromID(src.id), key = sp.replace($V$.dash, $V$.dot), a = key.split('.'), t = e.type, ge = $E$.getGEFromID(src.id);
            if (ge) {
                i = ge.length;
                while (i--) {
                    if ($E$.GE[ge[i]] == t) {
                        if (_.tryF($E$.GE[t + ge[i]], [e, ge], src) === false) {
                            $E$.stopBubble(e);
                            e = o = null;
                            return false;
                        }
                    }
                }
            }
            i = a.length;
            while (--i) {
                s = a.slice(0, i + 1).join(".");
                if (_.exists($E$[t][s]) && _.isA($E$[t][s])) {
                    for (j = 0; j <= 2; ++j) {
                        if ((_.tryF($E$[t][s][j], [e, s], src, true)) === false) {
                            $E$.stopBubble(e);
                            ret = false;
                            break;
                        }
                    }
                }
                if (ret === false) {
                    break;
                }
            }
        }
        e = o = null;
        return ret;
    }
    ;
    $E$.count = 0;
    $E$.el = ["mouseover", "mouseout", "mousedown", "mouseup", "mousemove", "click", "dblclick", "keydown", "keypress", "keyup", "resize", "scroll", "blur", "focus", "contextmenu", "load", "unload", "change", "reset", "select", "submit", "abort", "error", "ready"];
    var i = $E$.el.length;
    while (i--) {
        $E$[i] = $E$.el[i];
        $E$[$E$.el[i]] = {
        }
        ;
    }
    (function () {
//        $E$.getKeyFromID = function (id) {
//            return id.split($V$.colon)[0].split($V$.uline)[0];
//        }
//        ;
//        $E$.getGEFromID = function (id) {
//            return id.match(/(_)([a-zA-Z0-9]+)/g);
//        }
//        ;
        $E$.getSrc = function (e) {
            var a = e.target || e.srcElement || null;
            if (a) {
                a = (a.nodeType == 3) ? a.parentNode : a;
            }
            return a;
        }
        ;
        $E$.mType = function (e) {
            return _.N(e.which, e.button);
        }
        ;
        $E$.mPos = function (e) {
            e = e || window.event;
            if (e.pageX) {
                return {
                    x : e.pageX, y : e.pageY}
                ;
            }
            else {
                var sc = $E$.winScroll();
                return {
                    x : e.clientX + sc.x, y : e.clientY + sc.y}
                ;
            }
        }
        ;
        $E$.getKey = function (e) {
          var res = [], k = ((e.which)) ? e.which : (((e.keyCode)) ? e.keyCode : (((e.charCode)) ? e.charCode : 0)), key = String.fromCharCode(k).toLowerCase();
          if ((key >= 'a' && key <= 'z') || (key >= '0' && key <= '9')) {
              res.push(key);
          }
          else {
              switch (k) {
                  case 8:
                      res.push('$back');
                      break;
                  case 33:
                      res.push('$pup');
                      break;
                  case 34:
                      res.push('$pdown');
                      break;
                  case 35:
                      res.push('$end');
                      break;
                  case 36:
                      res.push('$home');
                      break;
                  case 45:
                      res.push('$insert');
                      break;
                  case 46:
                      res.push('$delete');
                      break;
                  case 13:
                      res.push('$enter');
                      break;
                  case 27:
                      res.push('$esc');
                      break;
                  case 32:
                      res.push('$space');
                      break;
                  case 9:
                  case 65289:
                      res.push('$tab');
                      break;
                  case 37:
                  case 52:
                  case 100:
                  case 65460:
                      res.push('$left');
                      break;
                  case 39:
                  case 54:
                  case 102:
                  case 65462:
                      res.push('$right');
                      break;
                  case 38:
                  case 56:
                  case 104:
                  case 65464:
                      res.push('$up');
                      break;
                  case 40:
                  case 50:
                  case 98:
                  case 65458:
                      res.push('$down');
                      break;
                      default : res.push(k);
                      break;
              }
          }
          if ((e.modifiers) ? false : (e.altKey || e.altLeft || k == 18 || k == 57388)) {
              res.push('$alt');
          }
          if ((e.modifiers) ? (e.modifiers & Event.CONTROL_MASK) : (e.ctrlKey || e.ctrlLeft || k == 17 || k == 57391)) {
              res.push('$ctrl');
          }
          if ((e.modifiers) ? (e.modifiers & Event.SHIFT_MASK) : (e.shiftKey || e.shiftLeft || k == 16 || k == 57390)) {
              res.push('$shift');
          }
          return res;
        }
        ;
        $E$.add = function (es, s, f, fb, fa) {
            if (!_.exists($E$[es])) {
                return;
            }
            if (!fb) {
                fb = null;
            }
            if (!fa) {
                fa = null;
            }
            if (!f) {
                f = null;
            }
            s = s.split($V$.uline)[0].replace($V$.dash, $V$.dot);
            $E$[es][s] = [fb, f, fa];
        }
        ;
        $E$.remove = function (s, eType, bRecursion) {
            if (eType == 'all') {
                var _self = arguments.callee;
                $E$.el.each(function (v, i) {
                    _self.call(null, s, v, bRecursion);
                }
                );
                return;
            }
            if (!_.exists($E$[eType])) {
                return;
            }
            s = s.split($V$.uline)[0].replace($V$.dash, $V$.dot);
            if (bRecursion === true) {
                _.filterH($E$[eType], function (i, v) {
                    if (i.startWith(s)) {
                        return false;
                    }
                }
                );
            }
            else {
                delete $E$[eType][s];
            }
        }
        ;
        $E$.stopBubble = function (e) {
            if (e.preventDefault) {
                e.preventDefastopBubbleult();
                e.stopPropagation();
            }
            else {
                e.returnValue = false;
                e.cancelBubble = true;
            }
            if (e.preventCapture) {
                e.preventCapture();
            }
        }
        ;
    }
    ());
    (function () {
        $E$.winSize = function () {
            return {
                w : window.innerWidth || document.documentElement.offsetWidth || document.body.offsetWidth, h : window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight}
            ;
        }
        ;
        $E$.winScroll = function () {
            return {
                x : self.pageXOffset || document.documentElement.scrollLeft || document.body.scrollLeft || 0, y : self.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop || 0}
            ;
        }
        ;
    }
    ());
    (function () {
        window.onload = function () {
            var i, l;
            //12-17由冯慧灵修改此处，由于util.js捕获了keypress事件，导致翻页脚标未能正常工作。
            //i = ["click", "dblclick", "mousedown", "mouseup", "mouseover", "mouseout", "keydown", "keypress", "keyup"];
            i = ["click", "dblclick", "mousedown", "mouseup", "mouseover", "mouseout", "keydown", "keyup"];
            l = i.length;
            while (l--) {
                if (!_.isF(document["on" + i[l]])) {
                    document["on" + i[l]] = function (e) {
                        return $E$(e);
                    }
                    ;
                }
            }
            document.oncontextmenu = function (e) {
                e = e || window.event;
                //$E$.stopBubble(e);
                return true;
            }
            ;
        }
        ;
        window.onunload = function () {
            try {
                $thread$.clear();
                var i, l;
                i = ["contextmenu", "click", "dblclick", "mousedown", "mouseup", "mouseover", "mouseout", "keydown", "keypress", "keyup"];
                l = i.length;
                while (l--) {
                    document["on" + i[l]] = null;
                }
                $d$(document.body).purge();
                var t, tag = $V$.linbTag;
                for (var i in window) {
                    if ((new RegExp(tag)).test(i)) {
                        _.destroyO(window[i]);
                    }
                }
                window._ = null;
                window.onfocus = window.onblur = window.onresize = null;
                window.onscroll = window.onload = window.onunload = null;
            }
            catch (e) {
            }
        }
        ;
        window.onscroll = function () {
        }
        ;
        window.onblur = function () {
        }
        ;
        window.onfocus = function () {
        }
        ;
        $E$.resize = [];
        window.onresize = function () {
            _.asyRun(function () {
                if (!$E$.resizeTime || ((new Date()).getTime() - $E$.resizeTime.getTime()) > 100) {
                    var funs = $E$.resize, i = funs.length;
                    funs.filter(function (o) {
                        return $d$(o.id) ? true : false;
                    }
                    );
                    for (var j = 0; j < i; ++j) {
                        _.tryF(funs[j].f);
                    }
                    $E$.resizeTime =  new Date();
                }
            }
            , 100);
        }
        ;
    }
    ());
    (function () {
        $E$.GE = {
        }
        ;
        var addGE = function (s, p, f) {
            p = _.isS(p) ? p : "";
            p = p.trim();
            var i = $E$.el.indexOf(s);
            if (i !=- 1) {
                i = $V$.uline + p + i;
                $E$.GE[i] = s;
                $E$.GE[s + i] = f;
            }
        }
        ;
        addGE("mouseover", null, function (e) {
            $d$(this).reClass($V$.css_mouseover);
            return false;
        }
        );
        addGE("mouseout", null, function (e) {
            $d$(this).reClass($V$.css_mouseout);
            return false;
        }
        );
        addGE("mousedown", null, function (e) {
            $d$(this).reClass($V$.css_mousedown);
            return false;
        }
        );
        addGE("mouseup", null, function (e) {
            $d$(this).reClass($V$.css_mouseup);
            return false;
        }
        );
        addGE("mouseover", 'p', function () {
            var p = $d$(this);
            if (p = p.parent()) {
                p.reClass($V$.css_mouseover);
                return false;
            }
        }
        );
        addGE("mouseout", 'p', function () {
            var p = $d$(this);
            if (p = p.parent()) {
                p.reClass($V$.css_mouseout);
                return false;
            }
        }
        );
        addGE("mouseover", 'pp', function () {
            var p = $d$(this);
            if (p = p.parent()) {
                if (p = p.parent()) {
                    p.reClass($V$.css_mouseover);
                    return false;
                }
            }
        }
        );
        addGE("mouseout", 'pp', function () {
            var p = $d$(this);
            if (p = p.parent()) {
                if (p = p.parent()) {
                    p.reClass($V$.css_mouseout);
                    return false;
                }
            }
        }
        );
    }
    ());
    (function () {
        $pool$.$E$_adhere = {
        }
        ;
        _.merge($E$, {
            setAdhere : function (ida, id, v, h, noClear) {
                var ah = $pool$.$E$_adhere;
                if (!noClear) {
                    _.filterH(ah, function (i) {
                        return (id === i || $d$(i)) ? true : false;
                    }
                    );
                }
                ah[id] = _.H(ah[id]);
                ah[id][ida] = [v, h];
            }
            , trigAdhere : function (id, os, op) {
                var _$d;
                if (!(_$d = $d$(id))) {
                    delete $pool$.$E$_adhere[id];
                    return;
                }
                var setH = function (pro, O, pO, pSize_o, pPos_o, pos, size) {
                    var t;
                    var type = pro[0];
                    var d1 = ((t = pro.length) > 1) ? parseFloat(pro[1]) : 0;
                    var d2 = (t > 2) ? parseFloat(pro[2]) : 0;
                    var pSize = pO.size(), pPos = pO.cssPos();
                    switch (type) {
                        case "il-":
                            pos.x = d1;
                            break;
                        case "il":
                            pos.x = d1;
                            break;
                        case "ilr":
                        case "irl":
                            pos.x = d1;
                            size.w = pSize.w - d1 - d2;
                            break;
                        case "ir-":
                            size.w = pSize.w - pos.x - d1;
                            break;
                        case "ihc":
                            pos.x = (pSize.w - size.w)/2.0 + d1; break; case "ir":
pos.x=pSize.w-size.w-d1; break; case "h-":
size.w += (pSize.w - pSize_o.w - d1); break; case "ol-":
size.w -= ((pPos.x + d1) - pos.x ); pos.x = pPos.x + d1; break; case "ol":
pos.x = pPos.x + d1; break; case "olr":
case "orl":
pos.x = pPos.x + d1; size.w = pPos.x + pSize.w - pos.x - d2; break; case "or-":
size.w = pO.absPos().x + pSize.w - O.absPos().x - d1; break; case "ohc":
pos.x = pPos.x + (pSize.w-size.w)/2.0 + d1;
                            break;
                        case "or":
                            pos.x = pPos.x + pSize.w - size.w + d1;
                            break;
                            default : break;
                    }
                    ;
                }
                ;
                var setV = function (pro, O, pO, pSize_o, pPos_o, pos, size) {
                    var t;
                    var type = pro[0];
                    var d1 = ((t = pro.length) > 1) ? parseFloat(pro[1]) : 0;
                    var d2 = (t > 2) ? parseFloat(pro[2]) : 0;
                    var pSize = pO.size(), pPos = pO.cssPos();
                    switch (type) {
                        case "it-":
                            pos.y = d1;
                            break;
                        case "it":
                            pos.y = d1;
                            break;
                        case "itb":
                        case "ibt":
                            pos.y = d1;
                            size.h = pSize.h - d1 - d2;
                            break;
                        case "ib-":
                            size.h = pSize.h - pos.y - d1;
                            break;
                        case "ivc":
                            pos.y = (pSize.h - size.h)/2.0 + d1; break; case "ib":
pos.y=pSize.h-size.h-d1; break; case "v-":
size.h += (pSize.h - pSize_o.h - d1); break; case "ot-":
size.h -= ((pPos.y + d1) - pos.y ); pos.y = pPos.y + d1; break; case "ot":
pos.y = pPos.y + d1; break; case "otb":
case "obt":
pos.y = pPos.y + d1; size.h = pPos.y + pSize.h -pos.y - d2; break; case "ob-":
size.h = pO.absPos().y + pSize.h - O.absPos().y - d1; break; case "ovc":
pos.y = pPos.y + (pSize.h-size.h)/2.0 + d1;
                            break;
                        case "ob":
                            pos.y = pPos.y + pSize.h - size.h + d1;
                            break;
                            default : break;
                    }
                    ;
                }
                ;
                var pool = $pool$.$E$_adhere[id];
                var _d, i, li, v, h, bak = {
                }
                ;
                for (i in pool) {
                    if (_d = $d$(i)) {
                        v = (li = pool[i])[0];
                        h = li[1];
                        var pos = _d.cssPos(), size = _d.size();
                        if (_.isA(v)) {
                            setV(v, _d, _$d, os, op, pos, size);
                        }
                        else if (_.isF(v)) {
                            _.tryF(v, [_d, _$d, os, op]);
                            continue;
                        }
                        if (_.isA(h)) {
                            setH(h, _d, _$d, os, op, pos, size);
                        }
                        _d.cssPos(pos).size(size);
                    }
                    else {
                        bak[i] = true;
                    }
                }
                for (i in bak) {
                    delete pool[i];
                }
            }
            , hasAdhere : function (id) {
                return _.exists($pool$.$E$_adhere[id]);
            }
            , setAdhereToWnd : function (id, f) {
                $E$.resize.push( {
                    id : id, f : f}
                );
            }
        }
        );
    }
    ());
}
());
(function () {
    window.$DD$ = {
        _indrag : false, _notFun : '_notFun', _targetID : '', _b : false, _bi : 8, aJustX : function (x) {
            var d = $DD$;
            if (d.$dockingoffset > 0) {
                var l = d.$dockingx.length;
                while (l--) {
                    if (Math.abs(x - d.$dockingx[l]) <= d.$dockingoffset) {
                        return d.$dockingx[l];
                    }
                }
            }
            else if (d.$gridw > 1) {
                return Math.floor((x + d.absOffX)/d.$gridw)*d.$gridw;}
return x;}, aJustY:function(y){ var d=$DD$; if(d.$dockingoffset>0){ var l=d.$dockingy.length; while(l--){ if(Math.abs(y - d.$dockingy[l])<=d.$dockingoffset){ return d.$dockingy[l];}
}
}else if(d.$gridh>1){ return Math.floor((y+d.absOffY)/d.$gridh) * d.$gridh;
            }
            return y;
        }
        , colEV1 : function (eb) {
            var d = $DD$, p = eb._pos;
            d._btn = eb._type;
            d._kb = eb._keyboard;
            d.mouseX = p.x;
            d.mouseY = p.y;
        }
        , colEV2 : function (eb, o) {
            var d = $DD$;
            d.__begin = (new Date()).getTime();
            d._kb = eb._keyboard;
            d._btno = eb._type;
            d._$d = o;
            d._wsize_ = $E$.winSize();
            d._scl_ = $E$.winScroll();
            d._size_ = o.size();
            d._absPos_ = o.absPos();
            d._cssPos_ = o.cssPos();
            d._topZ = false;
            d.$honly = 0;
            d.$vonly = 0;
            d.$offb = d.$offl = d.$offr = d.$offt = 100000000;
            d.$gridw = d.$gridh = 1;
            d.$dockingoffset =  - 1;
            d.$dockingx = d.$dockingy = [];
            if (d._pro) {
                _.merge(d, d._pro, "all");
            }
            d.originX = d.mouseX;
            d.originY = d.mouseY;
            d.cssOffX = d.mouseX - d._cssPos_.x;
            d.cssOffY = d.mouseY - d._cssPos_.y;
            d.absOffX = d.mouseX - d._absPos_.x;
            d.absOffY = d.mouseY - d._absPos_.y;
            d._limitL = d.mouseX - d.$offl;
            d._limitR = d.mouseX + d.$offr;
            d._limitT = d.mouseY - d.$offt;
            d._limitB = d.mouseY + d.$offb;
            d._oZ = d._$d.zIndex();
            d._$d.zIndex($V$.maxIndex);
            if (!d._pro.$noOpacity) {
                d._$d.css('opacity', 0.4);
            }
            if (d._pro.$noCursor !== true) {
                d._ocursor = o.cursor();
                o.cursor('move');
            }
        }
        , reEV : function () {
            var d = $DD$;
            if (!d._pro.$noOpacity) {
                d._$d.css('opacity', 1.0);
            }
            if (_.isS(d._ocursor)) {
                d._$d.cursor(d._ocursor);
            }
            if (d._$d) {
                d.unpack(d._topZ, d._targetID);
            }
            if (d.$selStart != d._notFun) {
                document.body.onselectstart = d.$selStart;
            }
            else {
                document.body.onselectstart = null;
            }
            if (d.$mousemove != d._notFun) {
                document.onmousemove = d.$mousemove;
            }
            else {
                document.onmousemove = null;
            }
            if (d.$mouseup != d._notFun) {
                document.onmouseup = d.$mouseup;
            }
            else {
                document.onmouseup = null;
            }
            d._btn = d.mouseX = d.mouseY = d.realX = d.realY = 0;
            d._kb = '';
            d.originX = d.cssOffX = d.originY = d.cssOffY = 0;
            d._limitL = d._limitR = d._limitT = d._limitB = d.$honly = d.$vonly = 0;
            d.$offb = d.$offl = d.$offr = d.$offt = 100000000;
            d._pro = null;
            d._wsize_ = d._scl_ = null;
            d._size_ = d._absPos_ = d._cssPos_ = null;
            d.$dockingoffset =  - 1;
            d.$dockingx = d.$dockingy = [];
            d.$mousemove = d.$mouseup = d.$selStart = d._notFun;
            d.$dragstart = d.$mousemove2 = d.$mouseup2 = d._notFun;
            d._data_ = null;
            d.$gridw = d.$gridh = 1;
            d.$ondrop = d.$startdrag = d.$ondrag = null;
            d._timer =  - 1;
            d._ocursor = null;
            d._oZ = 0;
            d._indrag = false;
            d._$d = null;
            d._targetID = '';
            d._topZ = false;
        }
        , startDrag : function (e, elm, pro, key, data, time) {
            e = e || window.event;
            if ($E$.mType(e) >= 2) {
                return true;
            }
            e.cancelBubble = true;
            $E$.stopBubble(e);
            var d = $DD$;
            var eb = {
            }
            ;
            eb._pos = $E$.mPos(e);
            eb._keyboard = $E$.getKey(e);
            eb._type = $E$.mType(e);
            eb._src = $E$.getSrc(e);
            var trigDrag = function () {
                if (d._indrag) {
                    return false;
                }
                if (eb._type == 0) {
                    return false;
                }
                d._pro = _.H(pro);
                d._data_ = data;
                d._key_ = key;
                elm = $d$(elm);
                if (elm) {
                    d._targetID = elm.id();
                    if (elm.parent()) {
                        if (elm.parent().id() == elm.id() + $V$.id_pack_tag) {
                            d._targetID = elm.parent().id();
                        }
                    }
                }
                var o = d.pack(eb._pos, elm);
                d.colEV1(eb, o);
                d.colEV2(eb, o);
                if (d.mouseX >= d._wsize_.w + d._scl_.x || d.mouseY >= d._wsize_.h + d._scl_.y) {
                    return true;
                }
                if ($d$.opr) {
                    var oo;
                    (oo = document.getElementById($V$.id_divopr)).style.pixelLeft = d.mouseX;
                    oo.style.pixelTop = d.mouseY;
                    (oo = oo.children[0].children[0]).focus();
                    oo.blur();
                }
                if ($d$.ie) {
                    d.$selStart = document.body.onselectstart;
                    if (document.selection && document.selection.empty) {
                        document.selection.empty();
                    }
                    document.body.onselectstart = function () {
                        event.returnValue = false;
                    }
                    ;
                }
                d._indrag = true;
                if (d.$mousemove2 !== d._notFun) {
                    document.onmousemove = d.$mousemove2;
                    d.$mousemove2 = d._notFun;
                }
                if (d.onDrag != document.onmousemove) {
                    d.$mousemove = document.onmousemove;
                    document.onmousemove = d.onDrag;
                }
                if (d.$mouseup2 !== d._notFun) {
                    document.onmouseup = d.$mouseup2;
                    d.$mouseup2 = null;
                }
                if (d.onDrop != document.onmouseup) {
                    d.$mouseup = document.onmouseup;
                    document.onmouseup = d.onDrop;
                }
                if ($DD$.$dragstart != d._notFun) {
                    document.ondragstart = $DD$.$dragstart;
                }
                _.tryF(d.$startdrag, [e]);
            }
            ;
            if ($d$.ie) {
                d.$dragstart = document.ondragstart;
                document.ondragstart = function () {
                    if ($DD$.$dragstart != d._notFun) {
                        document.ondragstart = $DD$.$dragstart;
                    }
                    return false;
                }
                ;
            }
            d.$mouseup2 = document.onmouseup;
            document.onmouseup = function (e) {
                alert("msg mouseUp util");
                if (d._timer !=  - 1) {
                    clearTimeout(d._timer);
                }
                eb._type = 0;
                if (d.$mousemove2 !== d._notFun) {
                    document.onmouseup = d.$mouseup2;
                    d.$mouseup2 = d._notFun;
                }
                return false;
            }
            ;
            d.$mousemove2 = document.onmousemove;
            document.onmousemove = function (e) {
                e = e || window.event;
                $E$.stopBubble(e);
                document.onmousemove = d.$mousemove2;
                d.$mousemove2 = d._notFun;
                if (eb._src == $E$.getSrc(e)) {
                    if (!d._indrag) {
                        if (d._timer !=  - 1) {
                            clearTimeout(d._timer);
                        }
                        trigDrag();
                    }
                }
                return false;
            }
            ;
            d._timer = _.asyRun(function () {
                if (!d._indrag) {
                    trigDrag();
                }
            }
            , _.isN(time) ? time : 100);
            return false;
        }
        , onDrag : function (e) {
            var d = $DD$, t;
            if (d._b === true) {
                return false;
            }
            d._b = true;
            setTimeout('$DD$._b = false;', d._bi);
            e = e || window.event;
            var eb = {
            }
            ;
            eb._pos = $E$.mPos(e);
            if (!d._indrag) {
                return false;
            }
            if ($d$.ie) {
                if ($E$.mType(e) === 0) {
                    d.onDrop(e);
                    return true;
                }
            }
            d.colEV1(eb);
            d.realX = d.$vonly ? d._cssPos_.x : d.aJustX(((d.mouseX <= d._limitL) ? d._limitL : (d.mouseX >= d._limitR) ? d._limitR : d.mouseX) - d.cssOffX);
            d.realY = d.$honly ? d._cssPos_.y : d.aJustY(((d.mouseY <= d._limitT) ? d._limitT : (d.mouseY >= d._limitB) ? d._limitB : d.mouseY) - d.cssOffY);
            d._$d.cssPos( {
                x : d.realX, y : d.realY}
            );
            _.tryF(d.$ondrag, [e]);
            d.testDropCur(d._key_);
            if (t = d._cur_) {
                if (t == d._ocur_) {
                    _.tryF(t.onDragOver, [d._key_, d._data_], t);
                }
                else {
                    _.tryF(t.onDragEnter, [d._key_, d._data_], t);
                    if (t = d._ocur_) {
                        _.tryF(t.onDragOut, [d._key_, d._data_], t);
                    }
                }
            }
            else {
                if (t = d._ocur_) {
                    _.tryF(t.onDragOut, [d._key_, d._data_], t);
                }
            }
            d._ocur_ = d._cur_;
            $E$.stopBubble(e);
            return false;
        }
        , onDrop : function (e) {
            e = e || window.event;
            var d = $DD$;
            if (!d._indrag) {
                return true;
            }
            _.tryF(d.$ondrop, [e]);
            if (d._cur_) {
                _.tryF(d._cur_['onDragDrop'], [d._key_, d._data_], d._cur_);
            }
            $DD$.reEV();
            $E$.stopBubble(e);
            return false;
        }
        , pack : function (mPos, elm) {
            var o, so, bo, pos = {
                x : null, y : null}
            , size = {
                w : null, h : null}
            , d = $DD$, pro = d._pro, idProxy = $V$.id_dragO, idBg = $V$.id_dragB, idProxyIcon = $V$.id_dragI, _this = elm, p, parent, _size;
            if (!['move', 'shape', 'copy', 'icon'].has(pro.$mode)) {
                pro.$mode = _.isS(pro.$icon) ? "icon" : "copy";
            }
            if (o = $d$(idProxy)) {
                o.remove();
            }
            if (o = $d$(idBg)) {
                o.remove();
            }
            if (o = $d$(idProxyIcon)) {
                o.remove();
            }
            switch (pro.$mode) {
                case "move":
                case "shape":
                case "copy":
                    if (_this.name() !== 'div') {
                        if (_this.parent().id() == _this.id() + $V$.id_pack_tag) {
                            _this = _this.parent();
                        }
                    }
                    if (_this.parent().id() == idProxy) {
                        return $d$(idProxy);
                    }
                    if (!_.exists(pro.$parent)) {
                        parent = _this.parent();
                    }
                    else {
                        parent = pro.$parent;
                    }
                    p = _this.css('position');
                    _size = _this.size();
                    size.w = _.N(d._pro.$w, _size.w);
                    size.h = _.N(d._pro.$h, _size.h);
                    if (p == "absolute") {
                        pos = _this.cssPos();
                    }
                    else {
                        pos = _this.absPos();
                    }
                    if (pro.$nobg !== true) {
                        o = $h$('div', {
                            id : idBg, style : 'display:block;position:absolute;border:none;overflow:visible; background: url(' + $V$.dragbgpic + ');'}
                        ).toDom();
                        parent.addLast(o);
                        o.size(size).cssPos(pos).css('opacity', 0.15).zIndex($V$.maxIndex - 1);
                        if (p == "absolute") {
                            o.cssPos(pos);
                        }
                        else {
                            o.absPos(pos);
                        }
                    }
                    break;
                case "icon":
                    if (!_.exists(pro.$parent)) {
                        parent = $d$(document.body);
                    }
                    else {
                        parent = pro.$parent;
                    }
                    break;
            }
            switch (pro.$mode) {
                case "shape":
                    bo = $h$('div', {
                        id : idProxy, style : 'position:absolute;border:dashed 1px;overflow:visible;width:auto;height:auto;'}
                    ).toDom();
                    parent.addLast(bo);
                    break;
                case "move":
                    if (_this.name() == 'div') {
                        bo = _this;
                        break;
                    }
                case "copy":
                    bo = $h$('div', {
                        id : idProxy, style : 'position:absolute;border:none;overflow:visible;width:auto;height:auto;'}
                    ).toDom();
                    parent.addLast(bo);
                    break;
                case "icon":
                    bo = $h$('div', {
                        id : idProxy, style : 'position:absolute;border:none;overflow:visible;width:auto;height:auto;'}
                    ).toDom();
                    parent.addLast(bo);
                    break;
            }
            switch (pro.$mode) {
                case "shape":
                    bo.size(size);
                    if (p == "absolute") {
                        bo.cssPos(pos);
                    }
                    else {
                        bo.absPos(pos);
                    }
                    break;
                case "move":
                    if (_this.name() == 'div') {
                        break;
                    }
                case "copy":
                    if (pro.$mode == "move") {
                        so = _this;
                    }
                    else {
                        so = _this.clone(true).id(_this.id() + ":bak");
                    }
                    bo.addLast(so);
                    so.cssPos( {
                        x : 0, y : 0}
                    );
                    if (p == "absolute") {
                        bo.cssPos(pos);
                    }
                    else {
                        bo.absPos(pos);
                    }
                    bo.size( {
                        w : _size.w + 10, h : _size.h + 10}
                    );
                    break;
                case "icon":
                    size.w = _.N(pro.$w, $V$.dragicon_size[0]);
                    size.h = _.N(pro.$h, $V$.dragicon_size[1]);
                    pos.x = _.N(pro.$x, mPos.x - size.w / 2);
                    pos.y = _.N(pro.$y, mPos.y - size.h / 2);
                    so = $h$('img', {
                        id : idProxyIcon, src : (_.S(pro.$icon, $V$.dragicon)), "width" : String(size.w), "height" : String(size.h), "style" : "vertical-align: top;text-align: left;line-height:1px;cursor:default;" + (pro.$style ? pro.$style : "")}
                    ).toDom();
                    $d$(document.body).addLast(bo);
                    bo.addLast(so);
                    bo.size(size).absPos(pos);
            }
            return bo;
        }
        , unpack : function (topZ, tar) {
            var d = $DD$, idProxy = $V$.id_dragO, idBg = $V$.id_dragB, idProxyIcon = $V$.id_dragI, t;
            switch (d._pro.$mode) {
                case "move":
                    if (idProxy != d._$d.id()) {
                        d._$d.zIndex($DD$._oZ);
                        break;
                    }
                    else {
                        t = $d$(idProxy);
                        t.parent().addLast(t.firstC());
                    }
                case "shape":
                case "copy":
                    if (t = $d$(idProxy)) {
                        var inner = t.firstC();
                        if (!inner ||  inner.id() != idProxyIcon) {
                            var f = $d$(tar);
                            if (f) {
                                if (f.name() == 'img') {
                                    f.css( {
                                        "verticalAlign" : "top", "textAlign" : "left"}
                                    );
                                }
                                var p1 = t.cssPos();
                                if (f.name() !== 'div') {
                                    var o = $h$('div', {
                                        id : (f.id() + $V$.id_pack_tag), style : 'position:absolute;border:none;overflow:visible;'}
                                    ).toDom();
                                    f.replace(o);
                                    o.addLast(f);
                                    f = o;
                                }
                                else {
                                    f.css('position', 'absolute');
                                }
                                f.cssPos(p1).show(true);
                                if (topZ) {
                                    f.topZ(true);
                                }
                            }
                        }
                        t.remove();
                    }
                    if (t = $d$(idProxy)) {
                        t.remove();
                    }
                    break;
                case "icon":
                    if (t = $d$(idProxy)) {
                        t.remove();
                    }
                    if (t = $d$(idProxyIcon)) {
                        t.remove();
                    }
                    break;
            }
            if (t = $d$(idBg)) {
                t.remove();
            }
        }
        , _cur_ : null, $ : {
        }
        , register : function (o, key) {
            var t, s = arguments.callee;
            if (_.isA(key)) {
                key.each(function (oo) {
                    s.call(null, o, oo);
                }
                );
            }
            else {
                t = $DD$.$[key] = _.A($DD$.$[key]);
                t.filter(function (o) {
                    return $d$(o.id()) ? true : false;
                }
                );
                t.push(o);
            }
        }
        , testDropCur : function (key) {
            var a, i, pos, size, l, t, r, b, o, d = $DD$;
            if (o = d._cur_) {
                l = o.__o_l;
                r = o.__o_r;
                b = o.__o_b;
                t = o.__o_t;
                if (d.mouseX >= l && d.mouseX <= r && d.mouseY >= t && d.mouseY <= b) {
                    return;
                }
            }
            if (a = d.$[key]) {
                i = a.length;
                while (i--) {
                    if ((o = a[i]).__pos_id == d.__begin) {
                        l = o.__o_l;
                        r = o.__o_r;
                        b = o.__o_b;
                        t = o.__o_t;
                    }
                    else {
                        pos = o.absPos();
                        size = o.size();
                        o.__o_l = l = pos.x;
                        o.__o_t = t = pos.y;
                        o.__o_r = r = l + size.w;
                        o.__o_b = b = t + size.h;
                        o.__pos_id = d.__begin;
                    }
                    if (d.mouseX >= l && d.mouseX <= r && d.mouseY >= t && d.mouseY <= b) {
                        d._cur_ = o;
                        return;
                    }
                }
            }
            d._cur_ = null;
        }
    }
    ;
}
());
(function () {
    window.$d$ = function (e) {
        if (e = $d$.ajust(e)) {
            var $ = {
                $d$ : true, e : e, end : function () {
                    this.e = null;
                }
                , parent : function () {
                    return $d$(this.e.parentNode);
                }
                , pre : function () {
                    return $d$(this.e.previousSibling);
                }
                , next : function () {
                    return $d$(this.e.nextSibling);
                }
                , firstC : function () {
                    return $d$(this.e.firstChild);
                }
                , lastC : function () {
                    return $d$(this.e.lastChild);
                }
                , nChild : function (n) {
                    var i, f = this.e.firstChild, l = this.e.lastChild;
                    for (i = 0; i < n; i++) {
                        if (f == l && i < n - 1) {
                            return;
                        }
                        f = f.nextSibling;
                    }
                    l = null;
                    return $d$(f);
                }
                , children : function () {
                    return this.e.childNodes;
                }
                , byTag : function (tag) {
                    var b = [], a = this.e.getElementsByTagName(tag);
                    for (var i = 0, l = a.length; i < l; ++i) {
                        b.push($d$(a[i]));
                    }
                    return b;
                }
                , clone : function (b) {
                    return $d$(this.e.cloneNode(b));
                }
                , addPre : function (o) {
                    if (o = $d$.ajust(o)) {
                        this.e.parentNode.insertBefore(o, this.e);
                    }
                    return this;
                }
                , addNext : function (o) {
                    if (o = $d$.ajust(o)) {
                        var n = this.e.nextSibling;
                        if (n) {
                            $d$(n).addPre(o);
                        }
                        else {
                            this.parent().addLast(o);
                        }
                    }
                    return this;
                }
                , addFirst : function (o) {
                    if (o = $d$.ajust(o)) {
                        var f = this.e.firstChild;
                        if (f) {
                            this.e.insertBefore(o, f);
                        }
                        else {
                            this.addLast(o);
                        }
                    }
                    return this;
                }
                , add : function (o) {
                    return this.addLast(o);
                }
                , addLast : function (o) {
                    if (o = $d$.ajust(o)) {
                        this.e.appendChild(o);
                    }
                    return this;
                }
                , addNth : function (o, n) {
                    if (o = $d$.ajust(o)) {
                        var i, f = this.e.firstChild, l = this.e.lastChild;
                        for (i = 0; i < n; i++) {
                            if (f == l && i < n - 1) {
                            }
                            else {
                                f = f.nextSibling;
                            }
                        }
                        $d$(f).addNext(o);
                        f = l = null;
                    }
                    return this;
                }
                , id : function (id) {
                    if (id) {
                        this.e.id = id;
                    }
                    else {
                        return this.e.id;
                    }
                    return this;
                }
                , type : function () {
                    return this.e.nodeType;
                }
                , isElem : function () {
                    return this.type() == 1;
                }
                , name : function () {
                    return this.e.nodeName.toLowerCase();
                }
                , reClass : function (s) {
                    var o = this.e;
                    if (_.isS(s)) {
                        var cs = s.toString();
                        if (_.isS(o.className)) {
                            o.className = cs;
                        }
                        else if (o.setAttribute) {
                            o.setAttribute("class", s);
                            o.className = cs;
                        }
                    }
                    else if (_.isA(s)) {
                        var regE =  new RegExp('(-)(\\w?)(\\w?)([\\b]|\\s| |$)', 'ig'), rstr = '$1$2$3$4', str, i, l;
                        for (i = 0, l = s.length; i < l; ++i) {
                            str = rstr.replace('$' + s[i].pos, s[i].chr);
                        }
                        this.reClass(o.className.replace(regE, str));
                    }
                    return this;
                }
                , reSrc : function (a, type) {
                    var o = this.e;
                    if ((o.nodeName).toLowerCase() == "img") {
                        type = _.S(type, "gif");
                        var regE =  new RegExp('(\\w*)(.' + type + '$)', 'ig');
                        o.src = o.src.replace(regE, a + '$2');
                    }
                    return this;
                }
                , attr : function (a, v) {
                    var o = this.e, fix = {
                        'for' : 'htmlFor', 'text' : 'cssText', 'class' : 'className', 'float' : 'cssFloat'}
                    ;
                    a = (fix[a] && fix[a].replace && fix[a]) || a;
                    var r =  new RegExp("-([a-z])", "ig");
                    a = a.replace(r, function (z, b) {
                        return b.toUpperCase();
                    }
                    );
                    if (_.isS(v)) {
                        o[a] = v;
                        if (o.setAttribute) {
                            o.setAttribute(a, v);
                        }
                    }
                    else {
                        return o[a] || o.getAttribute(a) || '';
                    }
                    return this;
                }
                , show : function (b) {
                    var o = this.e, s = o.style;
                    if (_.exists(b)) {
                        (s || o).visibility = (b ? 'visible' : 'hidden');
                    }
                    else {
                        return ((s || o).visibility == 'visible') ? true : false;
                    }
                    o = s = null;
                    return this;
                }
                , refresh : function () {
                    if ($d$.ie) {
                        this.e.outerHTML = this.e.outerHTML;
                    }
                    return this;
                }
                , enable : function (b) {
                    var o = this.e;
                    if (_.exists(b)) {
                        if (b) {
                            o.disabled = '';
                        }
                        else {
                            o.blur();
                            o.disabled = 'true';
                        }
                    }
                    else {
                        return o.disabled == '' ? true : false;
                    }
                    o = null;
                    return this;
                }
                , display : function (d) {
                    return this.css('display', d);
                }
                , css : function (p, v) {
                    v = (_.exists(v) && !_.isNull(v)) ? v : null;
                    if (!this.isElem()) {
                        return v ? '' : this;
                    }
                    var el = this.e, els = el.style;
                    if (_.isH(p)) {
                        for (var i in p) {
                            arguments.callee.call(this, i, p[i]);
                        }
                        el = els = null;
                        return this;
                    }
                    if (!_.isNull(v)) {
                        if (this.css(p) == v) {
                            el = els = null;
                            return this;
                        }
                        switch (p) {
                            case 'opacity':
                                if (v >= 1) {
                                    if (window.ActiveXObject) {
                                        els.filter = "";
                                        el = els = null;
                                        return this;
                                    }
                                    else {
                                        els.opacity = "";
                                        els['-moz-opacity'] = "";
                                        els['-khtml-opacity'] = "";
                                        el = els = null;
                                        return this;
                                    }
                                }
                                else if (v < 0.0) {
                                    els.opacity = "";
                                    els['-moz-opacity'] = "";
                                    els['-khtml-opacity'] = "";
                                }
                                if (v === 0 && this.show()) {
                                    this.show(false);
                                }
                                else if (!this.show()) {
                                    this.show(true);
                                }
                                if (window.ActiveXObject) {
                                    els.filter = "alpha(opacity=" + 100 * v + ")";
                                }
                                else {
                                    els.opacity = v;
                                    els['-moz-opacity'] = v;
                                    els['-khtml-opacity'] = v;
                                }
                                break;
                            case 'width':
                                if (this.name() == 'img') {
                                    if (el.width != v) {
                                        el.width = (v < 0 ? 0 : v);
                                    }
                                    el = els = null;
                                    return this;
                                }
                            case 'height':
                                if (this.name() == 'img') {
                                    if (el.height != v) {
                                        el.height = (v < 0 ? 0 : v);
                                    }
                                    el = els = null;
                                    return this;
                                }
                                default  : v = _.S(v.toString());
                                if (p.endWith('left|top|height|width|font-size')) {
                                    if (parseFloat(v).toString() == v) {
                                        v = $d$.toInt(v) + 'px';
                                    }
                                }
                                p = p.replace(/-([a-z])/ig, function (z, b) {
                                    return b.toUpperCase();
                                }
                                );
                                els[p] = v;
                        }
                    }
                    else {
                        var vv = null;
                        switch (p) {
                            case 'wh':
                            case 'hw':
                            case 'height':
                            case 'width':
                                var size = {
                                }
                                ;
                                if (this.name() == 'img') {
                                    size = {
                                        w : $d$.toInt(el.width), h : $d$.toInt(el.height)}
                                    ;
                                }
                                else {
                                    if (els.display != 'none') {
                                        var t, b = false;
                                        size = {
                                            h : _.N(t = $d$.toInt(els.height)) > 0 ? t : el.offsetHeight - _.N(this.css("border-top-width")) - _.N(this.css("border-bottom-width")), w : _.N(t = $d$.toInt(els.width)) > 0 ? t : el.offsetWidth - _.N(this.css("border-left-width")) - _.N(this.css("border-right-width"))}
                                        ;
                                    }
                                    else {
                                        var ov = els.show, op = els.position, od = els.display;
                                        els.show = 'hidden';
                                        els.position = 'absolute';
                                        els.display = '';
                                        size = {
                                            w : el.clientWidth, h : el.clientHeight}
                                        ;
                                        els.display = od;
                                        els.position = op;
                                        els.show = ov;
                                    }
                                }
                                vv = (p == 'height') ? size.h : (p == 'width') ? size.w : size;
                                break;
                            case 'opacity':
                                if (el.filters) {
                                    vv = 1;
                                    try {
                                        vv = el.filters.item('DXImageTransform.Microsoft.Alpha').opacity / 100;
                                    }
                                    catch (e) {
                                        try {
                                            vv = el.filters.item('alpha').opacity / 100;
                                        }
                                        catch (e) {
                                        }
                                    }
                                }
                                break;
                                default : p = p.replace(new RegExp("-([a-z])", "ig"), function (z, b) {
                                    return b.toUpperCase();
                                }
                                );
                                vv = els[p];
                                if (!vv) {
                                    if (document.defaultView && document.defaultView.getComputedStyle) {
                                        p = p.replace(/([A-Z])/g, "-$1").toLowerCase();
                                        var s = document.defaultView.getComputedStyle(el, null);
                                        vv = s ? s.getPropertyValue(p) : null;
                                    }
                                    else if (el.currentStyle && el.currentStyle[p]) {
                                        vv = el.currentStyle[p];
                                    }
                                }
                        }
                        p = p.toLowerCase();
                        if (['left', 'top', 'right', 'bottom'].has(p) || p.endWith('width|height')) {
                            vv = $d$.toInt(vv);
                        }
                        el = els = null;
                        return vv;
                    }
                    return this;
                }
                , size : function (size) {
                    var o = this.e;
                    if (size) {
                        this.trigAdhere();
                        if (!_.isNull(size.w)) {
                            this.css('width', size.w);
                        }
                        if (!_.isNull(size.h)) {
                            this.css('height', size.h);
                        }
                    }
                    else {
                        return this.css('wh');
                    }
                    o = null;
                    return this;
                }
                , cssPos : function (xy) {
                    if (xy) {
                        this.trigAdhere();
                        if (!_.isNull(xy.x)) {
                            this.e.style.left = xy.x + "px";
                        }
                        if (!_.isNull(xy.y)) {
                            this.e.style.top = xy.y + "px";
                        }
                    }
                    else {
                        return {
                            x : this.css('left'), y : this.css('top')}
                        ;
                    }
                    return this;
                }
                , relPos : function (pos) {
                    var el = this.e;
                    if (pos) {
                    }
                    else {
                        pos = {
                            x : 0, y : 0}
                        ;
                        do {
                            if ($d$.gek) {
                                pos.x++;
                                pos.y++;
                            }
                            pos.x += el.offsetLeft || 0;
                            pos.y += el.offsetTop || 0;
                            el = el.offsetParent;
                            if (el) {
                                if (['relative', 'absolute'].has($d$(el).css('position'))) {
                                    break;
                                }
                            }
                        }
                        while (el)if ($d$.opr) {
                            el = this.e.parentNode;
                            do {
                                pos.x += el.scrollLeft || 0;
                                pos.y += el.scrollTop || 0;
                                el = el.parentNode;
                                if (el) {
                                    if (['relative', 'absolute'].has($d$(el).css('position'))) {
                                        break;
                                    }
                                }
                            }
                            while (el);
                        }
                        return pos;
                    }
                    el = null;
                    return this;
                }
                , absPos : function (pos) {
                    var el = this.e;
                    if (pos) {
                        var absP = this.absPos();
                        var relP = this.relPos();
                        var x = null, y = null;
                        if (!_.isNull(pos.x)) {
                            x = pos.x - (absP.x - relP.x);
                        }
                        if (!_.isNull(pos.y)) {
                            y = pos.y - (absP.y - relP.y);
                        }
                        this.cssPos( {
                            x : x, y : y}
                        );
                    }
                    else {
                        pos = {
                            x : 0, y : 0}
                        ;
                        var box;
                        if ($d$.ie) {
                            box = el.getBoundingClientRect();
                            pos.x = box.left + document.documentElement.scrollLeft || document.body.scrollLeft;
                            pos.y = box.top + document.documentElement.scrollTop || document.body.scrollTop;
                        }
                        else if ($d$.gek) {
                            box = document.getBoxObjectFor(el);
                            pos.x = box.x;
                            pos.y = box.y;
                        }
                        else if ($d$.opr || $d$.kde) {
                            do {
                                if ($d$.kde) {
                                    if (el == document.body) {
                                        if ($d$(el).css('position') == 'absolute') {
                                            break;
                                        }
                                    }
                                }
                                pos.x += el.offsetLeft || 0;
                                pos.y += el.offsetTop || 0;
                            }
                            while (el = el.offsetParent);
                        }
                        if ($d$.gek) {
                            el = this.e.parentNode;
                            if (el) {
                                do {
                                    pos.x -= el.scrollLeft || 0;
                                    pos.y -= el.scrollTop || 0;
                                }
                                while (el = el.parentNode);
                            }
                        }
                        el = null;
                        return pos;
                    }
                    el = null;
                    return this;
                }
                , zIndex : function (d) {
                    if (_.isN(d) || (_.isS(d) && d.toLowerCase() == 'auto')) {
                        this.css('z-index', d);
                        this.css('zIndex', d);
                    }
                    else {
                        return $d$.toInt(this.css('z-index')) || $d$.toInt(this.css('zIndex'));
                    }
                    return this;
                }
                , resetZ : function () {
                    var list = {
                    }
                    ;
                    var c = this.children();
                    var l = c.length;
                    while (l--) {
                        var z = $d$(c[l]).zIndex();
                        if (z !== 0) {
                            if (!list[z]) {
                                list[z] = [];
                            }
                            list[z].push(c[l]);
                        }
                    }
                    var a = [];
                    for (var i in list) {
                        a.push([$d$.toInt(i), list[i]]);
                    }
                    a.sort(function (x, y) {
                        return x[0] - y[0];
                    }
                    );
                    l = a.length;
                    while (l--) {
                        a[l][1].each(function (o, i) {
                            $d$(o).zIndex(l + 1);
                        }
                        );
                    }
                    c = null;
                    return a.length + 1;
                }
                , topZ : function (a) {
                    var j, p = this.e.parentNode, f = p.firstChild, i = 0;
                    while (f = f.nextSibling) {
                        if (f != this.e) {
                            j = $d$(f).zIndex();
                            i = Math.max(i, j);
                        }
                    }
                    if (i >= $V$.maxIndex) {
                        i = $d$(p).resetZ();
                    }
                    if (a) {
                        this.zIndex(i + 1);
                    }
                    else {
                        j = this.zIndex();
                        return Math.max(i, j);
                    }
                    p = f = null;
                    return this;
                }
                , cursor : function (a) {
                    if (_.isS(a)) {
                        this.css('cursor', a);
                    }
                    else {
                        return this.css('cursor');
                    }
                    return this;
                }
                , bgColor : function (a) {
                    var o = this.e;
                    if (o.style) {
                        o = o.style;
                    }
                    if (a) {
                        if (o.bgColor) {
                            o.bgColor = a;
                        }
                        else if (o['background-color']) {
                            o['background-color'] = a;
                        }
                        else {
                            o.background = a;
                        }
                    }
                    else {
                        return (o.bgColor ? o.bgColor : o['background-color'] ? o['background-color'] : o.background);
                    }
                    o = null;
                    return this;
                }
                , replace : function (o) {
                    if (o = $d$.ajust(o)) {
                        this.e.parentNode.replaceChild(o, this.e);
                        return $d$(o);
                    }
                }
                , remove : function () {
                    if (this.e.parentNode) {
                        this.e.parentNode.removeChild(this.e);
                    }
                    return;
                }
                , empty : function () {
                    this.html('');
                    return this;
                }
                , resetCss : function (p) {
                    this.css(p, 'auto');
                    return this;
                }
                , escapeHTML : function () {
                    return $d$.escapeHTML(this.html());
                }
                , signLeak : function () {
                    this.e.$signLeak$ = true;
                    return this;
                }
                , purge : function () {
                    if (!$d$.ie) {
                        return this;
                    }
                    function purge(d) {
                        var a = d.attributes, i, l, n;
                        if (a) {
                            l = a.length;
                            for (i = 0; i < l; ++i) {
                                n = a[i].name;
                                if (typeof d[n] === 'function') {
                                    d[n] = null;
                                }
                            }
                        }
                    }
                    ;
                    var all = this.e.getElementsByTagName("*");
                    for (var i = 0, l = all.length; i < l; ++i) {
                        if (all[i].$signLeak$) {
                            purge(all[i]);
                        }
                    }
                    return this;
                }
                , html : function (s) {
                    if (_.exists(s)) {
                        if ($d$.ie) {
                            this.purge();
                        }
                        this.e.innerHTML = '';
                        this.e.innerHTML = s.toString();
                    }
                    else {
                        return this.e.innerHTML;
                    }
                    return this;
                }
                , text : function (s) {
                    if (_.isS(s)) {
                        if (this.e.childNodes[0]) {
                            this.e.childNodes[0].nodeValue = s;
                        }
                    }
                    else {
                        return this.e.childNodes[0] ? this.e.childNodes[0].nodeValue : '';
                    }
                    return this;
                }
                , hasClass : function (s) {
                    return (new RegExp("\\b" + s + "\\b")).test(this.e.className);
                }
                , setClass : function (s) {
                    if (!this.hasClass(s)) {
                        this.e.className += " " + s;
                    }
                    return this;
                }
                , busy : function () {
                    var id = this.id();
                    if (_.exists($d$._cusorPool[id])) {
                    }
                    else {
                        $d$._cusorPool[id] = _.S(this.cursor());
                        this.cursor('wait');
                        $d$.busy();
                    }
                    return this;
                }
                , free : function () {
                    var id = this.id(), ocr = 'default';
                    if (!_.exists($d$._cusorPool[id])) {
                    }
                    else {
                        ocr = _.S($d$._cusorPool[id], 'default');
                        this.cursor(ocr);
                        delete $d$._cusorPool[id];
                        $d$.free(ocr);
                    }
                    return this;
                }
                , 'eval' : function () {
                    this.byTag('script').each(function (v, i) {
                        eval(v.e.text || v.e.textContent || v.e.innerHTML);
                    }
                    );
                    return this;
                }
                , filter : function (s) {
                    this.byTag(s).each(function (o) {
                        o.remove();
                    }
                    );
                    return this;
                }
                , nextFocus : function (b) {
                    var s = arguments.callee, f;
                    if (!b) {
                        b = this.e;
                    }
                    if (b != this.e) {
                        if (this.canFocus()) {
                            if ($d$.tag.has(this.name())) {
                                try {
                                    this.focus();
                                }
                                catch (e) {
                                }
                                finally {
                                    b = null;
                                    return;
                                }
                            }
                        }
                    }
                    f = this.firstC();
                    if (f) {
                        s.call(f, b);
                        return;
                    }
                    else {
                        f = this.next();
                        if (f) {
                            s.call(f, b);
                            return;
                        }
                        else {
                            f = this.parent();
                            while (!f.next()) {
                                if (f.e == document.body) {
                                    f = f.firstC();
                                    s.call(f, b);
                                    return;
                                }
                                f = f.parent();
                            }
                            s.call(f.next(), b);
                            return;
                        }
                    }
                    b = f = null;
                }
                , preFocus : function (b) {
                    var s = arguments.callee, f;
                    if (!b) {
                        b = this.e;
                    }
                    if (b != this.e) {
                        if (this.canFocus()) {
                            if ($d$.tag.has(this.name())) {
                                try {
                                    this.focus();
                                }
                                catch (e) {
                                }
                                finally {
                                    b = null;
                                    return;
                                }
                            }
                        }
                    }
                    f = this.pre();
                    if (f) {
                        while (f.lastC()) {
                            f = f.lastC();
                            if (!f.canFocus()) {
                                break;
                            }
                        }
                        s.call(f, b);
                        return;
                    }
                    else {
                        f = this.parent();
                        if (f.e == document.body) {
                            while (f.lastC()) {
                                f = f.lastC();
                                if (!f.canFocus()) {
                                    break;
                                }
                            }
                        }
                        s.call(f, b);
                        return;
                    }
                    b = f = null;
                }
                , canFocus : function () {
                    return (this.e.offsetWidth > 0) || (this.e.offsetHeight > 0);
                }
                , focus : function () {
                    if (this.e.focus) {
                        this.e.focus();
                    }
                    return this;
                }
                , activate : function () {
                    this.focus();
                    if (this.e.select) {
                        this.e.select();
                    }
                }
                , setAdhere : function (id, v, h, noClear) {
                    $E$.setAdhere(this.e.id, id, v, h, noClear);
                }
                , trigAdhere : function () {
                    if ($E$.hasAdhere(this.e.id)) {
                        var _this = this;
                        if (!this.trigged) {
                            this.trigged = true;
                            if (this.adhereTrigger) {
                                clearTimeout(this.adhereTrigger);
                            }
                            var id = this.e.id, size = this.size(), pos = this.cssPos();
                            this.adhereTrigger = _.asyRun(function () {
                                delete _this.trigged;
                                $E$.trigAdhere(id, size, pos);
                                delete _this.adhereTrigger;
                            }
                            , 10);
                        }
                    }
                    return this;
                }
                , startDrag : function (e, pro, key, data) {
                    key = key || 'any';
                    data = data || null;
                    return $DD$.startDrag(e, this, pro, key, data);
                }
                , setDragable : function (bD, pro, key, data) {
                    var _t = this;
                    if (!_.exists(bD)) {
                        bD = true;
                    }
                    else {
                        if (_.isH(bD)) {
                            pro = bD;
                            bD = true;
                        }
                    }
                    _t.signLeak().e.onmousedown = (bD === true) ? (function (e) {
                        alert("msg mousedown util.js");
                        return _t.startDrag(e, pro, key, data);
                    }
                    ) : null;
                    return this;
                }
                , reSetAbsPos : function (pos) {
                    if (!this.e.style) {
                        return;
                    }
                    var o, pos2, c = this.children(), l = c.length;
                    if (!pos) {
                        pos = this.absPos();
                    }
                    while (l--) {
                        o = $d$(c[l]);
                        if (o.$d$) {
                            if (o.css('position') == "absolute") {
                                pos2 = o.relPos();
                                pos2.x -= pos.x;
                                pos2.y -= pos.y;
                                o.cssPos(pos2);
                            }
                            else {
                                if (o.$d$) {
                                    arguments.callee.call(o, pos);
                                }
                            }
                        }
                    }
                    return this;
                }
                , fx1 : function (args, onstart, onend, time, step, type) {
                    var trans = {
                        'liner' : function (arg, step, now) {
                            return arg[0] + (arg[1] - arg[0]) * (now / step);
                        }
                        , 'exp' : function (arg, step, now) {
                            return arg[0] + (arg[1] - arg[0]) * ((now * now)/(step*step));
							}
					};
					var transcolor=function(type, arg, step, j){ 
						var percent =trans[type]([0,100], step, j), from = arg[0], to = arg[1];
						if(!from || !to){return '#ffffff';}
						if(percent<0){return from;}
						else if(percent>100){return to;}
						if(from.substring(0,1)!='#'){from='#'+from;}
						if(to.substring(0,1)!='#'){to='#'+to;}
						from = { red:parseInt(from.substring(1,3),16)
							, green:parseInt(from.substring(3,5),16)
							, blue:parseInt(from.substring(5,7),16)
						};
						to = { red:parseInt(to.substring(1,3),16)
							, green:parseInt(to.substring(3,5),16)
							, blue:parseInt(to.substring(5,7),16)
						};
						var r=from.red+Math.round((percent/100) * (to.red - from.red));
						var g = from.green + Math.round((percent / 100) * (to.green - from.green));
						var b = from.blue + Math.round((percent / 100) * (to.blue - from.blue));
						r = (r < 16 ? '0' : '') + r.toString(16);
						g = (g < 16 ? '0' : '') + g.toString(16);
						b = (b < 16 ? '0' : '') + b.toString(16);
						return '#' + r + g + b;
					};
                    time = _.N(time, 210);
                    step = _.N(step, 3);
                    type = _.exists(trans[type]) ? type : 'liner';
                    var threadid = $ID$(), delay = time / step, funs = [], i, j, str;
                    for (j = 1; j <= step; ++j) {
                            str = 'var _t=$d$("' + this.e.id + '");if(!_t){$thread$("' + threadid + '").Abort();return;}';
                            for (i in args) {
                                if (i == 'background-color' || i == 'bgColor') {
                                    str += '_t.bgColor("' + transcolor(type, args[i], step, j) + '");';
                                }
                                else if (i == 'scrollTop' || i == 'scrollLeft') {
                                    str += '_t.e["' + i + '"]=' + trans[type](args[i], step, j) + ';';
                                }
                                else {
                                    str += '_t.css("' + i + '","' + trans[type](args[i], step, j) + '");';
                                }
                            }
                            str += 'delete _t.e; _t=null;';
                            funs.push(new Function(str));
                     }
                    return $thread$(threadid, $fx$ ? funs : [], delay, null, onstart, onend);//这里还有个线程 是处理什么的呢？
                 }
               }
               ;
                return $;
            }
        }
        ;
        _.merge($d$, {
            tag : ["a", "area", "label", "input", "select", "textarea", "button"], ajust : function (e) {
                return !e ? null  : (_.isS(e) ? document.getElementById(e) : (e.$d$ ? e.e : (e.$h$ ? e.toDom().e : e)));
            }
            , toInt : function (d_x, d_y) {
                return isNaN(d_y = parseInt(d_x)) ? 0 : d_y;
            }
            , create : function (tag) {
                return $d$(document.createElement(tag));
            }
            , move : function (from, to) {
                to.empty();
                var c = from.children();
                for (var i = 0, l = c.length; i < l; ++i) {
                    to.add(c[0]);
                }
            }
            , escapeHTML : function (s) {
                var o = $d$($V$.id_divforcreate).empty().addLast(document.createTextNode(s));
                var r = o.html();
                o.empty();
                return r;
            }
            , getPubData : function (key) {
                var d = $d$($V$.id_publicpool).html();
                if (d) {
                    var o = _.S2O(d);
                    if (o) {
                        if (_.exists(key)) {
                            return o[key];
                        }
                    }
                }
                return '';
            }
            , setPubData : function (key, v) {
                var d = $d$($V$.id_publicpool).html();
                if (d) {
                    var o = _.S2O(d);
                    if (_.isH(o)) {
                        o[key] = v;
                        $d$($V$.id_publicpool).html(_.O2S(o));
                    }
                }
                return '';
            }
            , _bodyoldcursor : "", _cusorPool : {
            }
            , busy : function () {
                $d$($V$.id_divTopO).css( {
                    'opacity' : '0.01', 'display' : 'block'}
                ).bgColor('#ffffff').cursor('wait');
                $d$(document.body).cursor("wait");
            }
            , free : function (ocr) {
                ocr = _.S(ocr, 'default');
                $d$(document.body).cursor(ocr);
                $d$($V$.id_divTopO).cursor(ocr).css( {
                    'display' : 'none'}
                );
            }
            , UIAction : function (id, f) {
                $thread$($ID$(), [function () {
                    $d$(id).busy();
                }
                , f, function () {
                    $d$(id).free();
                }
                ]).Start();
            }
        }
        );
        (function () {
            var sn = function () {
                var o = [];
                var u = navigator.userAgent.toLowerCase();
                if (document.all && document.getElementById && navigator.savePreferences && (u.indexOf('netfront') < 0) && navigator.appName != 'Blazer') {
                    o[0] = 'es5';
                }
                else if (navigator.vendor == 'KDE' || (document.childNodes && (!document.all || navigator.accentColorName) && !navigator.taintEnabled)) {
                    o[0] = 'kde';
                }
                else if (navigator.__ice_version) {
                    o[0] = 'ice';
                }
                else if (window.ScriptEngine && ScriptEngine().indexOf('InScript') + 1) {
                    if (document.createElement) {
                        o[0] = 'ic3';
                    }
                    else {
                        o[0] = 'icb';
                    }
                }
                else if (u.indexOf('hotjava') + 1 && typeof (navigator.accentColorName) == 'undefined') {
                    o[0] = 'hjv';
                }
                else if (document.layers && !document.classes) {
                    o[0] = 'omn';
                }
                else if (document.layers && !navigator.mimeTypes['*']) {
                    o[0] = 'esc';
                }
                else if (document.layers) {
                    o[0] = 'ns4';
                }
                else if (window.opera && u.indexOf('opera\/9.') + 1) {
                    o[0] = 'op9';
                }
                else if (window.opera && document.childNodes) {
                    o[0] = 'op7';
                }
                else if (u.indexOf('opera') + 1) {
                    o[0] = 'op6';
                }
                else if (navigator.appName.indexOf('WebTV') + 1) {
                    o[0] = 'wtv';
                }
                else if (u.indexOf('netgem') + 1) {
                    o[0] = 'nbx';
                }
                else if (u.indexOf('opentv') + 1) {
                    o[0] = 'otv';
                }
                else if (u.indexOf('ipanel') + 1) {
                    o[0] = 'ipn';
                }
                else if (document.getElementById && !document.childNodes) {
                    o[0] = 'clu';
                }
                else if (navigator.product == 'Gecko') {
                    o[0] = 'gek';
                }
                else if (document.getElementById && ((u.indexOf('netfront') + 1) || navigator.appName == 'Blazer')) {
                    o[0] = 'nf3';
                }
                else if (document.getElementById) {
                    if (u.indexOf("msie 6.") !=  - 1) {
                        o[0] = 'ie6';
                    }
                    else {
                        o[0] = 'ie5';
                    }
                }
                else if (document.all) {
                    o[0] = 'ie4';
                }
                else if ((u.indexOf('msie') + 1) && window.ActiveXObject) {
                    o[0] = 'pie';
                }
                else {
                    o[0] = 'oth';
                }
                if (u.indexOf('linux') + 1) {
                    o[1] = 'lin';
                }
                else if (u.indexOf('x11') + 1) {
                    o[1] = 'unx';
                }
                else if (u.indexOf('mac') + 1) {
                    o[1] = 'mac';
                }
                else if (navigator.platform == 'PalmOS') {
                    o[1] = 'plm';
                }
                else if ((navigator.platform == 'WinCE') || (navigator.platform == 'Windows CE') || (navigator.platform == 'Pocket PC')) {
                    o[1] = 'wce';
                }
                else if (u.indexOf('win') + 1) {
                    o[1] = 'win';
                }
                else if (u.indexOf('webtv') + 1) {
                    o[1] = 'wtv';
                }
                else if (u.indexOf('netgem') + 1) {
                    o[1] = 'ngm';
                }
                else if (u.indexOf('opentv') + 1) {
                    o[1] = 'otv';
                }
                else if (u.indexOf('symbian') + 1) {
                    o[1] = 'sym';
                }
                else {
                    o[1] = 'oth';
                }
                o[2] = (document.createElement && document.getElementsByTagName) ? true : false;
                return o;
            }
            ();
            $d$[sn[0]] = true;
            $d$[sn[1]] = true;
            $d$.opr = sn[0].startWith('op');
            $d$.ie = sn[0].startWith('ie');
            $d$.w3c = sn[2];
        }
        ());
    }
    ());
    (function () {
        window.$h$ = function (tag, attr, txt1, txt2) {
            var _$ = {
                $h$ : true, d : ['<', '', [], '>', '', [], '', ''], clone : function () {
                    var i, l, d = this.d, a = $h$(), ad = a.d;
                    ad[1] = d[1];
                    ad[4] = d[4];
                    ad[6] = d[6];
                    ad[7] = d[7];
                    if (d[2].length > 0) {
                        ad[2] = d[2].clone();
                    }
                    if (l = d[5].length > 0) {
                        for (i = 0; i < l; ++i) {
                            ad[5].push(d[5][i].clone());
                        }
                    }
                    return a;
                }
                , setE : function (name) {
                    if (_.isS(name)) {
                        if ($E$.el.has(name)) {
                            this.setAttr('on' + name, "return $E$(event,this);");
                        }
                    }
                    else if (_.isA(name)) {
                        for (var i = 0, l = name.length; i < l; ++i) {
                            this.setE(name[i]);
                        }
                    }
                    return this;
                }
                , html : function () {
                    var a2 = this.d[2], a5 = this.d[5], d = this.d, m = a5, l = m.length, a = new Array(l), i, r;
                    d[2] = a2.join('');
                    for (i = l - 1; i >= 0; --i) {
                        a[i] = m[i].html();
                    }
                    d[5] = a.join('');
                    r = d.join('');
                    this.d[2] = a2;
                    this.d[5] = a5;
                    return r;
                }
                , toDom : function () {
                    var _t, p = $d$($V$.id_divforcreate).html(this.html());
                    if (_t = p.firstC()) {
                        p = null;
                        return _t;
                    }
                    else {
                        return null;
                    }
                }
                , setTag : function (a) {
                    if (_.isS(a)) {
                        this.d[1] = a;
                        this.d[7] = (a.toLowerCase() == "img") ? "" : "</" + a + ">";
                    }
                    return this;
                }
                , setTxt : function (s1, s2) {
                    if (_.isS(s1)) {
                        this.d[4] = s1;
                    }
                    if (_.isS(s2)) {
                        this.d[6] = s2;
                    }
                    return this;
                }
                , addAttr : function (name, val) {
                    if (_.isS(name)) {
                        name = name.trim().toLowerCase();
                        val = val.trim();
                        if (val.length !== 0) {
                            this.d[2].push(" " + name + "='" + val + "'");
                        }
                    }
                    else {
                        for (var i in name) {
                            this.addAttr(i, name[i]);
                        }
                    }
                    return this;
                }
                , setAttr : function (name, val) {
                    var i;
                    if (_.isS(name)) {
                        name = name.trim().toLowerCase();
                        var a = this.d[2], l = a.length, bSet = false, temp;
                        for (i = 0; i < l; ++i) {
                            temp = " " + name + "='";
                            if (a[i].startWith(temp)) {
                                a[i] = $h$.at.replace($h$.ar, "$1" + name + "$3" + val + "$5");
                                bSet = true;
                                break;
                            }
                        }
                        if (!bSet) {
                            this.addAttr(name, val);
                        }
                    }
                    else if (_.isH(name)) {
                        for (i in name) {
                            this.setAttr(i, name[i]);
                        }
                    }
                    return this;
                }
                , delAttr : function (name) {
                    var i;
                    if (_.isA(name)) {
                        this.delAttr(name[i]);
                    }
                    else if (_.isS(name)) {
                        name = name.trim().toLowerCase();
                        var a = this.d[2], l = a.length, bSet = false, temp;
                        for (i = 0; i < l; ++i) {
                            temp = " " + name + "='";
                            if (a[i].startWith(temp)) {
                                a.splice(i, 1);
                                break;
                            }
                        }
                    }
                    return this;
                }
                , clearAttr : function (name, val) {
                    this.d[2] = [];
                    return this;
                }
                , addChild : function (s) {
                    this.d[5].push(s);
                    return this;
                }
                , lastC : function (s) {
                    return (this.d[5])[this.d[5].length - 1];
                }
                , toT : function () {
                    return $t$(this.html());
                }
            }
            ;
            return _$.setTag(tag).addAttr(attr).setTxt(txt1, txt2);
        }
        ;
        _.merge($h$, {
            at : " name='val'", ar :/(^ )(\w+)(=\')(.+)(\'$)/}
        );
        window.$t$ = function (str) {
            var _$ = {
                $t$ : true, d : "", dout : [], setTxt : function (s) {
                    this.d = s;
                    return this;
                }
                , addTxt : function (s, p) {
                    if (p === true) {
                        this.d = s + this.d;
                    }
                    else {
                        this.d += s;
                    }
                    return this;
                }
                , html : function () {
                    var s;
                    if (this.dout.length == 0) {
                        s = this.d;
                    }
                    else {
                        s = this.dout.join('');
                    }
                    this.dout.length = 0;
                    return s;
                }
                , toDom : function () {
                    var s = this.html();
                    var p = $d$($V$.id_divforcreate).html(s);
                    if (_t = p.firstC()) {
                        p = null;
                        return _t;
                    }
                    else {
                        return null;
                    }
                }
                , resetT : function (k, v) {
                    if (_.isH(k)) {
                        for (var i in k) {
                            this.d = this.d.replace(new RegExp(i, 'img'), k[i]);
                        }
                    }
                    else {
                        if (_.isB(v.$t$) || _.isB(v.$h$)) {
                            v = v.html();
                        }
                        this.d = this.d.replace(new RegExp(k, 'img'), v);
                    }
                    return this;
                }
                , clearOut : function () {
                    this.dout.length = 0;
                    return this;
                }
                , build : function (k, v) {
					//alert(arguments.length);
                    var n = this.d;
                    if (_.isH(k)) {
                        for (var i in k) {
							//alert("before replace"+n);
                            n = n.replace(new RegExp(i, 'img'), k[i]);
							//alert("after replace"+n);
                        }
                    }
                    else {
                        if (_.isB(v.$t$) || _.isB(v.$h$)) {
                            v = v.html();
                        }
                        n = n.replace(new RegExp(k, 'img'), v);
                    }
                    this.dout.push(n);
                    return this;
                }
                , clone : function () {
                    return $t$(this.d);
                }
                , findAllTags : function (reg) {
                    if (!_.isS(reg)) {
                        reg = "<%[\w|\-|*|\s]*%>";
                    }
                    return this.d.match(reg);
                }
            }
            ;
            return _$.setTxt(str);
        }
        ;
    }
    ());
    (function () {
        document.write("<div id='" + $V$.id_divforcreate + "' style='display:none;width:0px;height:0px'></div>");
        document.write("<div id='" + $V$.id_publicpool + "' style='display:none;width:0px;height:0px'>{}</div>");
        document.write("<div id='" + $V$.id_divTopO + "' style='cursor:wait;position:absolute;display:none;left:0px;top:0px;z-index:10;background-color: #ffffff;'></div>");
        document.write("<div  id='" + $V$.id_divTopI + "'style='cursor:wait;position:absolute;display:none;top:50%;left:50%;z-index:20;' ><img src=" + $V$.topLoading + " alt='' style='border:none;' /><div id='" + $V$.id_divTopM + "'></div></div>");
        $E$.setAdhereToWnd($V$.id_divTopO, function () {
            $d$($V$.id_divTopO).size($E$.winSize()).end();
        }
        );
        if ($d$.op7 || $d$.op9) {
            document.write("<div id='" + $V$.id_divopr + "' style='position:absolute;visibility:hidden;width:0px;height:0px;'><form><input type='text' style='width:0px;height:0px;'><\/form><\/div>");
        }
    }
    ());
    window.$a$ = function (url, success_cb, fail_cb, threadid, para, method, bCache, cacheTime, bRefresh, noUI) {
        var _t, cacheId, bAjax = true;
        if (bCache === true  && bRefresh !== true) {
            cacheId = (url + "|+|" + _.O2S(para)).hashCode();
            if (_t = $pool$.getT(cacheId)) {
				//alert("exist===================="+success_cb);
                _.tryF(success_cb, [_t]);
                bAjax = false;
            }
        }
        ;
        if (bAjax === true) {
            var id = $ID$();
            var $ = {
                id : '', url : window.location.href, method : "GET", mimeType : "text/xml", username : null, password : null, reqDone : false, queryString : "", txt : null, xml : null, status : null, statusText : null, aborted : false, timeout : 0, showLoading : 0, flag_timeout : 0, flag_showmsg : 0, retryCount : 0, retryDelay : 1000, xmlHttpObj : null, _retry : false, _retryNo : 0, _onIniHandled : false, paras : {
                }
                , headers : {
                }
                , onInitialization : null, onFinalization : null, onReadyStateChange : null, onLoading : null, onLoaded : null, onInteractive : null, onComplete : null, onSuccess : null, onFatalError : null, onError : null, onTimeout : null, onLoadingMsg : null, onRetryDelay : null, onRetry : null, getXmlHttpObj : function () {
                    var xmlhttp = null, em = ['MSXML2.XMLHTTP.7.0', 'MSXML2.XMLHTTP.6.0', 'MSXML2.XMLHTTP.5.0', 'MSXML2.XMLHTTP.4.0', 'MSXML2.XMLHTTP.3.0', 'MSXML2.XMLHTTP', 'MSXML3.XMLHTTP', 'MSXML.XMLHTTP'];
                    try {
                        try {
                            xmlhttp =  new XMLHttpRequest();
                        }
                        catch (e) {
                            var i = em.length;
                            while (i--) {
                                try {
                                    xmlhttp =  new ActiveXObject(em[i]);
                                }
                                catch (e) {
                                }
                            }
                        }
                    }
                    catch (e) {
                    }
                    return xmlhttp;
                }
                , _initObject : function () {
                    if (this.xmlHttpObj !== null) {
                        this.xmlHttpObj.onreadystatechange = function () {
                        }
                        ;
                        this.xmlHttpObj = null;
                    }
                    if ((this.xmlHttpObj = this.getXmlHttpObj()) === null) {
                        return null;
                    }
                    if (_.exists(this.xmlHttpObj.overrideMimeType)) {
                        this.xmlHttpObj.overrideMimeType(this.MimeType);
                    }
                    var o = this, x = o.xmlHttpObj;
                    function _handler() {
                        o.raiseEvent("ReadyStateChange", o, x.readyState);
                        switch (x.readyState) {
                            case 1:
                                o._onLoading.apply(o);
                                break;
                            case 2:
                                o._onLoaded.apply(o);
                                break;
                            case 3:
                                o._onInteractive.apply(o);
                                break;
                            case 4:
                                o._onComplete.apply(o);
                                x.onreadystatechange = function () {
                                }
                                ;
                                x = null;
                                o = null;
                                break;
                        }
                    }
                    x.onreadystatechange = _handler;
                    this._onLoadingHandled = this._onLoadedHandled = this._onInteractiveHandled = this._onCompleteHandled = false;
                }
                , _onLoading : function () {
                    if (this._onLoadingHandled) {
                        return;
                    }
                    this.raiseEvent("Loading", this);
                    this._onLoadingHandled = true;
                }
                , _onLoaded : function () {
                    if (this._onLoadedHandled) {
                        return;
                    }
                    this.raiseEvent("Loaded", this);
                    this._onLoadedHandled = true;
                }
                , _onInteractive : function () {
                    if (this._onInteractiveHandled) {
                        return;
                    }
                    this.raiseEvent("Interactive", this);
                    this._onInteractiveHandled = true;
                }
                , _onComplete : function () {
                    var x = this.xmlHttpObj;
                    if (this._onCompleteHandled || this.aborted) {
                        this.xmlHttpObj.onreadystatechange = function () {
                        }
                        ;
                        this.xmlHttpObj = null;
                        return;
                    }
                    this.reqDone = true;
                    this.txt = decodeURIComponent(x.responseText);
                    this.xml = x.responseXML;
                    if (_.exists(x.status)) {
                        this.status = x.status;
                    }
                    if (_.exists(x.statusText)) {
                        this.statusText = x.statusText;
                    }
                    this.raiseEvent("Complete", this);
                    this._onCompleteHandled = true;
                    if (this.status === undefined || this.status === 0 || (this.status >= 200)) {
                        this.raiseEvent("Success", this);
                    }
                    else {
                        this.raiseEvent("Error", this,  new Error('XMLHttp return ' + this.status));
                    }
                    if (this.flag_timeout > 0) {
                        clearTimeout(this.flag_timeout);
                    }
                    if (this.flag_showmsg > 0) {
                        clearTimeout(this.flag_showmsg);
                    }
                    this.raiseEvent("Finalization", this);
                    this.txt = null;
                    this.xml = null;
                    _.breakO(this.paras);
                    _.breakO(this.headers);
                    _.breakO(this);
                    x = this.xmlHttpObj = null;
                }
                , _onLoadingMsg : function (t) {
                    if (t === null  || t.xmlHttpObj === null  || t._onCompleteHandled) {
                        return;
                    }
                    t.raiseEvent("LoadingMsg", t);
                }
                , _onTimeout : function (t) {
                    if (t === null  || t.xmlHttpObj === null  || t._onCompleteHandled) {
                        return;
                    }
                    t.aborted = true;
                    t.xmlHttpObj.abort();
                    t.raiseEvent("Timeout", t);
                    t._retry = true;
                    if (t._retryNo != t.retryCount) {
                        t._initObject();
                        if (t.retryDelay > 0) {
                            t.raiseEvent("RetryDelay", t);
                            startTime =  new Date().getTime();
                            while (new Date().getTime() - startTime < t.retryDelay) {
                            }
                        }
                        t._retryNo++;
                        t.raiseEvent("Retry", t, t._retryNo);
                        t.run();
                    }
                    else {
                        if (t.xmlHttpObj) {
                            t.xmlHttpObj.onreadystatechange = function () {
                            }
                            ;
                            t.xmlHttpObj = null;
                        }
                        t.raiseEvent("Finalization", t);
                    }
                }
                , run : function () {
                    var _this = this;
                    this._initObject();
                    if (this.xmlHttpObj === null) {
                        return false;
                    }
                    this.aborted = false;
                    if (!this.onIniHandled) {
                        this.raiseEvent("Initialization", this);
                        this.onIniHandled = true;
                    }
					
                    if (!this._retry) {
                        for (var a in this.paras) {
                            if (this.queryString.length > 0) {
                                this.queryString += "&";
                            }
                            if (_.isS(this.paras[a])) {
                                this.queryString += encodeURIComponent(a) + "=" + encodeURIComponent(this.paras[a]);
                            }
                            else {
                                for (var i = 0; i < this.paras[a].length; i++) {
                                    this.queryString += encodeURIComponent(a) + "=" + encodeURIComponent(this.paras[a][i]) + "&";
                                }
                                this.queryString = this.queryString.slice(0,  - 1);
                            }
                        }
                        if (this.method == "GET" && this.queryString.length > 0) {
                            this.url += (this.url.indexOf("?") !=  - 1 ? "&" : "?") + this.queryString;
                        }
                    }
                    try {
                        this.xmlHttpObj.open(this.method, this.url, true, this.username || '', this.password || '');
                    }
                    catch (e) {
                        this.raiseEvent("FatalError", this, e);
                        return;
                    }
                    if (this.timeout > 0) {
                        this.flag_timeout = _.asyRun(function () {
                            _this._onTimeout(_this);
                        }
                        , this.timeout);
                    }
                    if (this.showLoading > 0) {
                        this.flag_showmsg = _.asyRun(function () {
                            _this._onLoadingMsg(_this);
                        }
                        , this.showLoading);
                    }
                    try {
                        if (typeof (this.xmlHttpObj.setRequestHeader) != 'undefined') {
                            for (var d in this.headers) {
                                this.xmlHttpObj.setRequestHeader(encodeURIComponent(d), encodeURIComponent(this.headers[d]));
                            }
                        }
                        if (this.method == "POST" && typeof (this.xmlHttpObj.setRequestHeader) != 'undefined') {
                            this.xmlHttpObj.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
							this.queryString = this.queryString.replace(/%/g,"%25");
                           // this.xmlHttpObj.send(this.queryString);
                        }
                        else if (this.method == "GET") {
                            this.xmlHttpObj.send('');
                        }
                    }
                    catch (e) {
                        this.raiseEvent("Error", this, e);
                    }
                }
                , setArgs : function (args) {
                    for (var a in args) {
                        if (!_.exists(this[a])) {
                            this.paras[a] = args[a];
                        }
                        else {
                            if (a != "paras" && a != "headers") {
                                this[a] = args[a];
                            }
                            else {
                                for (var b in args[a]) {
                                    this[a][b] = args[a][b];
                                }
                            }
                        }
                    }
                    this.method = this.method.toUpperCase();
                    return this;
                }
                , addPara : function (n, v) {
                    var t;
                    if (!_.exists(t = this.paras[n])) {
                        this.paras[n] = v;
                    }
                    else {
                        if (_.isS(t)) {
                            this.paras[n] = [t, v];
                        }
                        else {
                            this.paras[n][t.length] = v;
                        }
                    }
                    return this;
                }
                , delPara : function (n) {
                    delete this.paras[n];
                    return this;
                }
                , raiseEvent : function (n) {
                    var a = [];
                    for (var i = 1; i < arguments.length; ++i) {
                        a.push(arguments[i]);
                    }
                    _.tryF(this["on" + n], a);
                    if (n == "FatalError") {
                        this.raiseEvent("Finalization", this);
                    }
                }
            }
            ;
            if (noUI !== true) {
                $.setArgs( {
                    showLoading : 100, onLoadingMsg : function (v) {
                        $a$.loadingMsg($a$, v);
                    }
                }
                );
            }
            $.setArgs( {
                id : id, url : url, method : (_.S(method).toUpperCase() == "GET") ? "GET" : "POST", paras : {
                    id : id, para : _.S(para)}
                , timeout : 5000, retryCount : 1, retryDelay : 0, onInitialization : function (v) {
                    $a$.initialization($a$, v, threadid);
                }
                , onSuccess : function (v) {
                    $a$.success($a$, v);
                }
                , onFatalError : function (v, e) {
                    $a$.error($a$, v, e);
                }
                , onError : function (v, e) {
                    $a$.error($a$, v, e);
                }
                , onTimeout : function (v) {
                    $a$.timeout($a$, v);
                }
                , onRetry : function (v) {
                    $a$.retry($a$, v);
                }
                , onFinalization : function (v) {
                    $a$.finalization($a$, v, success_cb, fail_cb, threadid, bCache, cacheId, cacheTime);
                }
            }
            ).run();
        }
    }
    ;
    _.merge($a$, {
        onLoadingCache : {
        }
        , ResultCache : {
        }
        , visible : false, retry : function (o, _this) {
            o.sendMsg('retry:' + _this.id);
        }
        , timeout : function (o, _this) {
            o.sendMsg('timeout:' + _this.id);
        }
        , error : function (o, _this, e) {
            o.sendMsg('Error in thread "' + _this.id + '":' + _.formatErr(e));
        }
        , loadingMsg : function (o, _this) {
            if (!o.visible) {
                o.visible = true;
                $d$($V$.id_divTopO).css( {
                    'opacity' : '0.2', 'display' : 'block'}
                );
                $d$($V$.id_divTopI).css('display', 'block');
            }
        }
        ,  initialization : function (o, _this, threadid) {
            _this.OK = false;
            if (_.isS(threadid)) {
                $thread$(threadid).Sleep();
            }
        }
        , finalization : function (o, _this, success_cb, fail_cb, threadid, bCache, cacheId, cacheTime) {
            delete o.onLoadingCache[_this.id];
            if (_.isEmpty(o.onLoadingCache)) {
                if (o.visible) {
                    o.visible = false;
                    $d$($V$.id_divTopO).css('display', 'none');
                    $d$($V$.id_divTopI).css('display', 'none');
                }
                $d$($V$.id_divTopM).empty();
            }
            var args, cb;
            if (_this.OK === true) {
                cb = success_cb;
                //alert(_this.txt);
                args = [_this.txt];
                if (bCache === true) {
                    $pool$.addT(cacheId, _this.txt, cacheTime);
                }
            }
            else {
                cb = fail_cb;
                args = [];
            }
			//alert(args);
            if (_.isS(threadid)) {
                $thread$(threadid).insertTasks([ {
                    id : "ajaxresult", task : cb, args : args, target : cb}
                ]);
                $thread$(threadid).Resume();
            }
            else {
				//alert(cb);

                _.tryF(cb, args);
            }
        }
        , success : function (o, _this) {
            _this.OK = true;
        }
        , sendMsg : function (s) {
            var o = $d$($V$.id_divTopM);
            o.html(o.html() + s + "<br>");
        }
    }
    );
    (function () {
        window.$history$ = {
            current_query : '', timeFlag :- 1, setCmdByKey : function (k, v, bAll) {
                var s = String(window.location.hash).replace('#', '');
                $history$.setCommand(s.URIv(k, v), bAll);
            }
            , setCommand : function (s, bAll) {
                var _t = window.location;
                if ($d$.ie) {
                    _t.href = _t.pathname + "#" + s;
                    var o = window.frames[$V$.id_history_iframe];
                    if (o) {
                        _t.href = _t.pathname + "#" + s;
                        if (o.location.hash !== s) {
                            o.location.href = o.location.pathname + "?" + s + "#" + s;
                        }
                    }
                }
                else {
                    _t.hash = "#" + s;
                }
                if (bAll === true) {
                    $history$.current_query = "#" + s;
                }
            }
            , action : function () {
                var _t = window.location.hash;
				//alert("action");
				//alert(_t);
				//alert($history$.current_query);
                if (_t !== $history$.current_query && _t !== '' && _t !== '#' && _.isF($pool$.$pageaction$)) {
                    $thread$('$thread_history').Sleep();
                    $pool$.$pageaction$(_t.replace('#', ''));
                    $history$.current_query = _t;
                    $thread$('$thread_history').Resume();
                }
            }
            , clear : function () {
                $history$.current_query = "";
            }
        }
        ;
       // $thread$('$thread_history', [$history$.action], 1000, null, null, null, true).Start();//这个线程估计是处理历史记录的
        if ($d$.ie) {
            document.write("<iframe style='border:0px; width:0px; height:1px; position:absolute; left:-100px; top:-100px; visibility:visible;' name='" + $V$.id_history_iframe + "' id='" + $V$.id_history_iframe + "' src='" + $V$.id_history_iframe + ".html'></iframe>");
        }
    }
    ());
    $CLASS$("tools", null, {
    }
    );
    $CLASS$("tools.cookie", "tools", {
        $static$ : {
            set : function (n, v, days) {
                n = encodeURIComponent(n);
                v = encodeURIComponent(v);
                var ep;
                if (_.isN(days)) {
                    var date =  new Date();
                    date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000));
                    ep = "; expires=" + date.toGMTString();
                }
                else {
                    ep = "";
                }
                document.cookie = n + "=" + v + ep + "; path=/";
            }
            , get : function (n) {
                n = encodeURIComponent(n);
                var nEQ = n + "=";
                var ca = document.cookie.split(';');
                for (var i = 0; i < ca.length; i++) {
                    var c = ca[i];
                    while (c.charAt(0) == ' ') {
                        c = c.substring(1, c.length);
                    }
                    if (c.indexOf(nEQ) === 0) {
                        return decodeURIComponent(c.substring(nEQ.length, c.length));
                    }
                }
                return '';
            }
            , del : function (n) {
                createCookie(n, "",  - 1);
            }
        }
    }
    );


//linb standard shell
(function(){
    var i,_t;
    for(i in _t={
        isA : "isArr",
        isB : "isBool",
        isC : "isCls",
        isD : "isDate",
        isF : "isFun",
        isH : "isHush",
        isN : "isNumb",
        isS : "isStr",

        A : "arr",
        B : "bool",
        C : "cls",
        D : "date",
        F : "fun",
        H : "hush",
        N : "numb",
        S : "str",

        O2S : "obj2Str",
        S2O : "str2Obj",
        S2D : "str2Date",
        I2A : "iterator2Arr"
    }){_[_t[i]]=_[i];}

    window.linb={
        ini     : $V$,
        SC      : $SC$,
        pool    : $pool$,
        dom     : $d$,
        html    :{
            elem        :$h$,
            template    :$t$
        },
        ajaxCall: $a$,
        thread  : $thread$,
        event   : $E$,
        dragDrop: $DD$,
        newID   : $ID$,
        history : "$history$",

        DEBUG   : $debug$,
        FX      : $fx$
    };

    if(!window["$"]){$=$d$;}
}());
var Class={create:function(){
return function(){
this.initialize.apply(this,arguments);
};
}};


var MsgContainer = Class.create();
MsgContainer.prototype = {
	initialize:function(){
		this.id = 1 ;//分配ID 这块必须完善 ID不能光分配 不回收 或者也不能重复 因为每个form的提交是不一样的
		this.dragEffect = null;
		this.current = null;
		this.dragging = false;
		this.startedDragging = false;
		this.counter = -1;
        this.uri = "/testLinb/msgProc";
		this.opFlag = null;
        //this.css = ".window { position: absolute;}";
		//this.event = "";
	},
	setContainer:function(w){
		this.container = document.getElementById(w);
	},
	createRsvMsgBox:function(callback){

		var para ;
		para=_.H(para);
		para.action = "view"; 
		para.arg = {sender:sender, condition:""};
		$a$("/msgProc",
                		function(txt){
						//alert(txt);
						var o = _.S2O(txt);
						//if(_.isA(o.updates)) alert(o);
						if((o.updates)&&_.isA(o.updates)){
							var template  = $t$("<td align=\"center\" height=\"25\">类型"+
								"</td><td align=\"center\" height=\"25\">标题"+
								"</td><td align=\"center\" height=\"25\">发送者"+
								"</td><td align=\"center\" height=\"25\">内容"+
								"</td>");
							//+
						//"<input type='button' name='Submit' value='回复' onclick='msgContainer.sendMsg(form"+msgContainer.id+")'>"+
						//"<INPUT name=ButtonEnd onclick=end() type=button value='取 消'></td></tr></table></div>");
						var index = 1 ;
						o.updates.each(function(oo){
									var nextRow = document.getElementById("receiveMsg").firstChild.insertRow(index++);
									var type = nextRow.insertCell(0);
									var title = nextRow.insertCell(1);
									var sender = nextRow.insertCell(2);
									var content = nextRow.insertCell(3);
									type.innerHTML = oo.type;
									title.innerHTML = oo.title;
									sender.innerHTML = oo.sender;
									content.innerHTML = oo.content;
                                });
						}
                		},
                	function(){
                    	
                	},
                	null, _.O2S(para), 'POST', null, null, null, true);
	},
	createMsgBox:function(callback){
		this.id++;
		this.opFlag = arguments[1];
		var e;
		if(this.opFlag == "send"){
			e = document.createElement("<div onmousedown=\""+callback+".setCurrent(this)\" onmousemove=\""+callback+".calcResize(this)\"></div>");
			e.id = "window"+this.id;
			this.body ="<div  style='float:right;height:20px;'><img src='/getResourceServlet/img/Gradient.gif' style='width:150px;height:20px;'>"+
					"<img src='/getResourceServlet/img/min.gif' max='/getResourceServlet/img/max.gif' min='/getResourceServlet/img/min.gif' onclick=\""+callback+".controlSizeOfMsgBox(document.getElementById('window"+this.id+"'));\" "+
					"style='border-left:solid 1px #ffffff;border-top:solid 1px #ffffff;border-right:solid 1px #808080;border-bottom:solid 1px #808080;'>"+
					"<img src='/getResourceServlet/img/close.gif' onclick=\""+callback+".destroyMsgBox(document.getElementById('window"+this.id+"'));\"></div>"+
					"<div ><table cellspacing=1 cellpadding=2 width='100%' align=center border=0>"+   
					"<form action='/ImProcess' id='form"+this.id+"' name='form"+this.id+"' language='javascript' method='post'>"+
					"<tr bgcolor=#e6f4ff><td colspan=2 bgcolor='#eeefff'><table width='100%'><tr><td>请选择消息类型："+
					"<select name='msgType'  style='width:150'><option value='public'>公开消息</option>"+
					"<option value='private'>私聊消息</option></select></td></tr><tr height=20><td >收信人："+
					"<input maxlength=20 name='receiver' size='15' ></td></tr><tr height=20><td >标题： "+
					"<input maxlength=20 name='title' size='15'></td></tr><tr><td>内容：</td></tr><tr>"+ 
					"<td><textarea name='content' cols='50' rows='4'></textarea></td></tr><tr><td>"+
					"<input type='button' name='Submit' value='发 送' onclick='"+callback+".sendMsg(form"+this.id+")'>"+
					"</td></tr></table></div>";
			e.style.position = "absolute";
			e.style.top = "50px";
			e.style.left = "50px";
			e.style.width = "400px";
			e.style.height = "300px";
		}
		else if(this.opFlag == "receive"){
			this.id--;
			e = document.createElement("<div onmousedown=\""+callback+".setCurrent(this)\" onmousemove=\""+callback+".calcResize(this)\"></div>");
			e.id = "window"+this.id;
			this.body = arguments[2];
			
			e.style.position = "absolute";
			e.style.top = "50px";
			e.style.left = "50px";
			e.style.width = "400px";
			e.style.height = "300px";
		}
		else if(this.opFlag == "receiveAll"){
			e = document.createElement("<tr onMouseOver=\"MouseOn(this);\" onMouseOut=\"MouseOuto(this);\"></tr>");
			e.id = "RsvMsgwindow"+arguments[3];
			this.body = arguments[2];
			
			

		}
		e.innerHTML = this.body;
		return e;
	},
	controlSizeOfMsgBox:function(w)
	{
		//alert("minimize");
		var ele1 = w.firstChild,ele2 = ele1.nextSibling;
		var imgChange = ele1.firstChild.nextSibling;
		if(imgChange.src.indexOf(imgChange.min)!=-1){
			this.changeImg(imgChange,"max");
			ele2.style.display = "none";
		}
		else if(imgChange.src.indexOf(imgChange.max)!=-1){
			this.changeImg(imgChange,"min");
			ele2.style.display = "";
		}
	},
	changeImg:function(_1,_2){
		if(_2=="max"){
			_1.src = _1.max;
		}
		else if(_2=="min"){
			_1.src = _1.min;
		}
	},
	destroyMsgBox:function(w){
		//alert("destroy");
		this.container.removeChild(w);
	},
	createMsgList:function(){
	},
	setCurrent:function(w){
	  
		if (w != this.current)
		{
			// unset old current
			if (this.current)
				this.current.className = 'MsgBox';
			// set current
			this.current = w;
			this.current.className = 'current MsgBox';
			// put current on top
			this.container.appendChild(this.current);
		}
		// init drag
		var offsetX = event.x - parseInt(w.currentStyle.left);
		var offsetY = event.y - parseInt(w.currentStyle.top);
		if (offsetY < 80)
		{
			this.dragging = true;
			this.dragEffect = function()
			{
				w.style.pixelLeft = event.x - offsetX;
				w.style.pixelTop = event.y - offsetY;
			}
		} 
		else 
		{
			var width = parseInt(w.currentStyle.width);
			var resizeX = offsetX > width - 10;
			var height = parseInt(w.currentStyle.height);
			var resizeY = offsetY > height - 10;
			if (resizeX || resizeY)
			{
				this.dragging = true;
				var offsetX = event.x - width;
				var offsetY = event.y - height;
				this.dragEffect = function()
				{
					if (resizeX)
						w.style.pixelWidth = event.x - offsetX;
					if (resizeY)
						w.style.pixelHeight = event.y - offsetY;
				}
			}
		} 
	},
	calcResize:function(w)
	{ 
	  
		var offsetX = event.x - parseInt(w.currentStyle.left);
		var offsetY = event.y - parseInt(w.currentStyle.top);
		var width = parseInt(w.currentStyle.width);
		var resizeX = offsetX > width - 10;
		var height = parseInt(w.currentStyle.height);
		var resizeY = offsetY > height - 10;
		w.style.cursor = (resizeX||resizeY)?(resizeY?"S":"")+(resizeX?"E":"")+"-resize":"default";
	},
	moveCurrent:function()
	{
		if (!this.dragging || !this.current)
		return;
		if (event.button == 0)
		{
			this.releaseCurrent();
			return;
		}
 
		if (!this.startedDragging)
		{
			this.current.className = 'dragging current MsgBox';
			this.startedDragging = true;
		}
		this.dragEffect();
	},
	releaseCurrent:function()
	{
		if (!this.current)
		return;
 
		this.current.className = 'current MsgBox';
		this.dragging = false;
		this.startedDragging = false;
	},
	makeUnselectable:function(e)
	{
		e.unselectable=true;
		if (e.className == 'content')
		return;
 
		for (var c=e.firstChild;c;c=c.nextSibling)
		if (c.nodeType == 1)
		this.makeUnselectable(c);
	},
	sendMsg : function(para){
		/*var type = form.msgType.value;
		var title = form.title.value;
        var receiver = form.receiver.value;
	    var content = form.content.value;
		content = content.replace(/\"/g,"\\\"");//双引号特殊处理 NND
		if(title == "") alert("标题不能为空！");
		else if(receiver == "") alert("收信人不能为空！");
		else if(content == "") alert("内容不能为空！");
		else{
			this.msgProcess('$msgProcess', {action:"send", counter:this.counter, arg:{sender:sender, receiver:receiver,title:title,type:type,content:content}});
		}*/
		//var para = {action:"send", counter:this.counter, arg:{sender:'sdfsdf', receiver:'admin',title:'sdfdsfdsfdsfdsf',type:'public',content:'sssssssssss'}};
            
	    //this.msgProcess('$msgProcess', {action:"send", counter:1, arg:{sender:"gyx", receiver:receiver,content:content}});
		//para=_.H(para);
		$a$("/msgProc",null,null,null, _.O2S(para), 'POST', null, null, null, true);

    },
	msgProcess:function(threadid, para)
	{
	  $thread$("$msgProcess").Sleep();
    para=_.H(para);
    para.counter = 0;
    //alert(para.action);
    //alert(para.arg);
    if(!para.action) para.action = "receive";
    if(!para.arg) para.arg = {sender:sender, receiver:"",title:"",type:"",content:""};
    $a$("/msgProc",
          function(txt){
						//alert(txt);
						var o = _.S2O(txt);
						//if(_.isA(o.updates)) alert(o);
						if((o.updates)&&_.isA(o.updates)){						
  						var multiPara = "{";
  						var count = 0;
  						var flag = 0;
  						o.updates.each(
  						  function(oo){
  						    flag = 1;
    							var eTxt = '' ;
    							for(var i in oo){
    								//此处用于修正双重编码的问题。
    								//eTxt = eTxt + i + ":'" + encodeURIComponent(oo[i]) + "',";
    								eTxt = eTxt + i + ":'" + oo[i] + "',";
    							}
    							eTxt = eTxt.substring(0,eTxt.length-1);
    							eTxt = "{"+eTxt+"}";
    							eTxt = eTxt.replace(/%/g,"%25");
    							multiPara = multiPara+"arg"+count+":"+eTxt+",";
    							count = count+1;
    							//alert(receiverHTMLTemplate+"?para="+eTxt);
    							//var wh= window.open(receiverHTMLTemplate+"?para="+eTxt, "",'location=no,scrollbars=no,menubar=no,status=yes,resizable=1,width=800,height=600,left=0,top=0');
    							//wh.focus();
  							}
  						);
  						if (flag == 1){
    						multiPara = multiPara +"count:"+count+",currentNum:0}";
    						//此下一部分代码进行了替换，用以解决使用window.open造成的URL参数被截断的问题，
    						//参数传递时，不得大于1024字节，因此改用动态Form来完成这一工作。
    						//注意新增加的form的target。
    						//var wh= window.open(receiverHTMLTemplate+"?multiPara="+multiPara, "",'location=no,scrollbars=no,menubar=no,status=yes,resizable=1,width=600,height=460,left=0,top=0');
      					//wh.focus();      					
      					window.open('about:blank',  "newPage",'location=no,scrollbars=no,menubar=no,status=yes,resizable=1,width=600,height=460,left=0,top=0');  
      					var myForm = "<form  name=form1form1  action="+receiverHTMLTemplate+" target='newPage'  method=post><input name=multiPara ></form>";
								document.body.insertAdjacentHTML("beforeEnd",myForm);
								document.form1form1.multiPara.value=multiPara;  								
								document.form1form1.submit();  
								document.form1form1.removeNode(true);
    				  }
						}
						$thread$("$msgProcess").Resume();	//如果把这句去掉，那么在第一次发送完信息之后，chat这个线程就不再存在了
          },
          function(){
            $thread$("$msgProcess").Resume();
          },
          null, _.O2S(para), 'POST', null, null, null, true);
	}
};
var msgContainer = new MsgContainer(); function appendMsgBox(){document.getElementById("sendMsg").appendChild(msgContainer.createMsgBox("msgContainer","send"));} </SCRIPT>

<DIV id=sendMsg></DIV>
<DIV id=receiveMsg></DIV>
<DIV id=msgManaged></DIV>
<SCRIPT language=JavaScript1.2>msgContainer.setContainer("sendMsg"); $thread$("$msgProcess", [msgContainer.msgProcess], 3000, null, null, null, true).Start();</SCRIPT>

<SCRIPT>
window.onload = tick;
</SCRIPT>
</BODY></HTML>
